create account

UtopianJ - Utopian API Java Client by aafeng

View this thread on: hive.blogpeakd.comecency.com
· @aafeng · (edited)
$44.21
UtopianJ - Utopian API Java Client
## Project Info

This project is a wrapper of the Utopian APIs in Java. Java Developers can use this tool to call Utopian APIs easily.

## Technology Stack

[Java 9](https://www.oracle.com/java/java9.html)

## License

MIT

## Features

List moderators

List sponsors

Check if a user is a moderator

Check if a user is a supervisor

Check if a user is a sponsor

Get all posts satisfying given criteria

Get a particular post information

Check Utopian bot stats

Check if Utopian bot is voting

## Test

All provided methods are tested with JUnit test cases:

https://github.com/aa-feng/utopianj/blob/master/src/test/java/io/utopian/UtopianJTest.java

## How to use it?

This project is managed by Maven. After git clone this project to your PC, assuming you have installed Maven, then:

### Install this project to your local Maven repository

```bash
mvn install 
```

### Use this project

Add this project in your project’s pom.xml, e.g.:

```xml
    <dependency>
      <groupId>com.aafeng</groupId>
      <artifactId>utopianj</artifactId>
      <version>0.1</version>
    </dependency>
```

Then, you can use it in Java:

```java
import com.aafeng.UtopianJ;

UtopianJ.getModerators();
UtopianJ.isModerator("espoem");
UtopianJ.isSupervisor("espoem");
UtopianJ.getSponsors();
UtopianJ.isSponsor("espoem");

MultivaluedMap<String,String> params = new MultivaluedHashMap<String,String>();
params.add("limit","1");
JSONObject posts = UtopianJ.getPosts(params);

UtopianJ.getPost("espoem","sidebar-in-the-post-jumps-to-the-top-of-the-page");

UtopianJ.getStats();

UtopianJ.isVoting();
```

## Roadmap

The following features will be added:

* More information about moderators, e.g. payouts

* Information about Utopian categories

* Add relevant Java class, e.g. Moderator, Category, Post, to make this tool more Developer friendly

## How to contribute

Github: https://github.com/aa-feng/utopianj

Just fork this project, create your feature branch, and send a pull request.

## Proof of work

I have changed my github profile page to show my Steemit user account:

![](https://steemitimages.com/DQmZxj41zVvRKkB6SNb4YUG6fm39JnsSt7zEv2PkdHB8Czb/image.png)

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@aafeng/utopianj-utopian-api-java-client">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authoraafeng
permlinkutopianj-utopian-api-java-client
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":125343392,"name":"utopianj","full_name":"aa-feng/utopianj","html_url":"https://github.com/aa-feng/utopianj","fork":false,"owner":{"login":"aa-feng"}},"pullRequests":[],"platform":"github","type":"development","tags":["utopian-io","java","programming","api"],"links":["https://www.oracle.com/java/java9.html"],"moderator":{"account":"helo","time":"2018-03-17T12:33:55.726Z","reviewed":true,"pending":false,"flagged":false},"questions":[{"question":"Is the project description formal?","answers":[{"value":"Yes it’s straight to the point","selected":false,"score":10},{"value":"Need more description ","selected":true,"score":5},{"value":"Not too descriptive","selected":false,"score":0}],"selected":1},{"question":"Is the language / grammar correct?","answers":[{"value":"Yes","selected":true,"score":20},{"value":"A few mistakes","selected":false,"score":10},{"value":"It's pretty bad","selected":false,"score":0}],"selected":0},{"question":"Was the template followed?","answers":[{"value":"Yes","selected":true,"score":10},{"value":"Partially","selected":false,"score":5},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"How do you rate the amount of work?","answers":[{"value":"Very High","selected":false,"score":20},{"value":"High","selected":false,"score":16},{"value":"Medium","selected":true,"score":12},{"value":"Low","selected":false,"score":7},{"value":"Very Low","selected":false,"score":3}],"selected":2},{"question":"How do you rate the impact on the Project?","answers":[{"value":"Very High","selected":false,"score":20},{"value":"High","selected":false,"score":16},{"value":"Medium","selected":true,"score":12},{"value":"Low","selected":false,"score":7},{"value":"Very Low","selected":false,"score":3}],"selected":2}],"score":60}"
created2018-03-16 17:44:21
last_update2018-03-17 12:33:57
depth0
children4
last_payout2018-03-23 17:44:21
cashout_time1969-12-31 23:59:59
total_payout_value31.504 HBD
curator_payout_value12.704 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,329
author_reputation554,723,599,569,926
root_title"UtopianJ - Utopian API Java Client"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id44,805,855
net_rshares15,427,869,213,681
author_curate_reward""
vote details (36)
@aafeng ·
@originalworks
properties (22)
authoraafeng
permlinkre-aafeng-utopianj-utopian-api-java-client-20180317t013934113z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["originalworks"],"app":"steemit/0.1"}
created2018-03-17 01:39:36
last_update2018-03-17 01:39:36
depth1
children0
last_payout2018-03-24 01:39:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length14
author_reputation554,723,599,569,926
root_title"UtopianJ - Utopian API Java Client"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id44,861,105
net_rshares0
@helo ·
$0.05
Thank you for the contribution. It has been approved.

A little more expansion of the description would have been better.

Do you have a project that will use this library?

You like @espoem?  Well I like him too. ;-)

You can contact us on [Discord](https://discord.gg/uTyJkNm).
**[[utopian-moderator]](https://utopian.io/moderators)**
👍  
properties (23)
authorhelo
permlinkre-aafeng-utopianj-utopian-api-java-client-20180317t123555788z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-17 12:35:57
last_update2018-03-17 12:35:57
depth1
children1
last_payout2018-03-24 12:35:57
cashout_time1969-12-31 23:59:59
total_payout_value0.040 HBD
curator_payout_value0.012 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length336
author_reputation121,547,934,535,311
root_title"UtopianJ - Utopian API Java Client"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id44,944,978
net_rshares15,609,483,364
author_curate_reward""
vote details (1)
@aafeng ·
$0.28
Thanks for your feedback. I will add more description in next version. I used to call Utopian API directly in my Java app to generate some Utopian statistics report and feel it would be easier if there is a Java wrapper. I will use it in my report tool and maybe other projects. Yes, I like @espoem very much and appreciate for all his hard work. BTW, I like his icon too, LOL
👍  
properties (23)
authoraafeng
permlinkre-helo-re-aafeng-utopianj-utopian-api-java-client-20180317t131305335z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["espoem"],"app":"steemit/0.1"}
created2018-03-17 13:13:06
last_update2018-03-17 13:13:06
depth2
children0
last_payout2018-03-24 13:13:06
cashout_time1969-12-31 23:59:59
total_payout_value0.210 HBD
curator_payout_value0.070 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length376
author_reputation554,723,599,569,926
root_title"UtopianJ - Utopian API Java Client"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id44,950,740
net_rshares80,246,128,101
author_curate_reward""
vote details (1)
@utopian-io ·
### Hey @aafeng I am @utopian-io. I have just upvoted you!
#### Achievements
- Seems like you contribute quite often. AMAZING!
#### Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. <a href="https://discord.gg/zTrEMqB">Participate on Discord</a>. Lets GROW TOGETHER!
- <a href="https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1">Vote for my Witness With SteemConnect</a>
- <a href="https://v2.steemconnect.com/sign/account-witness-proxy?proxy=utopian-io&approve=1">Proxy vote to Utopian Witness with SteemConnect</a>
- Or vote/proxy on <a href="https://steemit.com/~witnesses">Steemit Witnesses</a>

[![mooncryption-utopian-witness-gif](https://steemitimages.com/DQmYPUuQRptAqNBCQRwQjKWAqWU3zJkL3RXVUtEKVury8up/mooncryption-s-utopian-io-witness-gif.gif)](https://steemit.com/~witnesses)

**Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x**
properties (22)
authorutopian-io
permlinkre-aafeng-utopianj-utopian-api-java-client-20180318t033003662z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-18 03:30:03
last_update2018-03-18 03:30:03
depth1
children0
last_payout2018-03-25 03:30:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,004
author_reputation152,955,367,999,756
root_title"UtopianJ - Utopian API Java Client"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id45,066,136
net_rshares0