create account

【Programming】Java Development vol.1 / SteemJを用いてJavaプログラムからSteem APIを実行する。 by promari

View this thread on: hive.blogpeakd.comecency.com
· @promari · (edited)
$14.57
【Programming】Java Development vol.1 / SteemJを用いてJavaプログラムからSteem APIを実行する。
[Steem API](https://developers.steem.io/)には[JavaScript](https://ja.wikipedia.org/wiki/JavaScript)や[Python](https://ja.wikipedia.org/wiki/Python)、[Java](https://ja.wikipedia.org/wiki/Java)から呼び出すためのライブラリが公開されています。今回JavaプログラムからSteem APIを実行し、各種情報を表示したいと思います。

まず、以下のページに行き、JavaからSteem APIを呼び出すための[SteemJ](https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project)と呼ばれるライブラリをクローンします。

https://github.com/marvin-we/steem-java-api-wrapper

![0k9qc2ta3w.png](https://img.esteem.ws/0k9qc2ta3w.png)

クローンしたプロジェクトを[統合開発環境(IDE)](https://ja.wikipedia.org/wiki/%E7%B5%B1%E5%90%88%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83)で開きます。ここでは[IntelliJ IDEA](https://ja.wikipedia.org/wiki/IntelliJ_IDEA)としてプロジェクトを動作させたいと思います。

クローンしたプロジェクトを開きます。

![8kczj5iknd.png](https://img.esteem.ws/8kczj5iknd.png)

プロジェクトをビルドします。

![klez8dbwyr.png](https://img.esteem.ws/klez8dbwyr.png)

my.sample.project.SteemJUsageExample.javaを参考にし、アカウント名とプライベートキーをソースに記述します。

![g3xd70ld2t.png](https://img.esteem.ws/g3xd70ld2t.png)
##### ※赤枠の箇所を各自のアカウント情報に書き換えます。

試しに[promari](https://steemit.com/@promari)のアカウントからフォロー情報を取得してみましょう。

![a8px9bex48.png](https://img.esteem.ws/a8px9bex48.png)

コンソールにアカウントのフォロワー情報が取得されています。

![47sl1c5y86.png](https://img.esteem.ws/47sl1c5y86.png)

SteemJはJavaからsteem API実行するためのラッパーライブラリなので、これを使えばボットや各種集計などを手軽にツールとして実行することが可能です。

時間がありましたら色々とこのSteemJを使ってSteemをいじくり倒してみたいと思います。

![RGgukq5E6HBS5wrYDNU5euL5kWt6DCj2LPGHAqZSwkfuoLdEdH7eB2otBDVMtGomJ8P4VL5cKfjf69rtMbw4585DE9g1mLB8NZM7JXuMHuBBCgyw74nJcZCj8hD8Z6n.png](https://ipfs.busy.org/ipfs/QmYQChjSnbGyuXBF36PYZ7dh59GzrVQguEZwoE9rnBJkaM)
written by [tamito0201](https://steemit.com/@tamito0201/)

プログラミングとのご縁結びなら[プロマリ](https://www.programming-mariage.jp/)へ。

オンラインプログラミング学習スクールの[プロマリ](https://www.programming-mariage.jp/)は、プログラミングの初学者の皆様を応援しています。プログラミング講師と一緒に面白いアプリを作りませんか。

<a href="https://www.programming-mariage.jp">![btpb5hmlur.png](https://img.esteem.ws/btpb5hmlur.png)</a>

<a href="https://www.programming-mariage.jp/about">![omchy0nhkl.png](https://img.esteem.ws/omchy0nhkl.png)</a>

The programming school "[Promari](https://www.programming-mariage.jp/)" will help you learn programming. "[Promari](https://www.programming-mariage.jp/)" is supporting the first scholars of programming. Let's develop an application with our programming instructor.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 590 others
properties (23)
authorpromari
permlinkjava-steemj-java-steem-api
categorypromari
json_metadata{"links":["https://developers.steem.io/","https://ja.wikipedia.org/wiki/JavaScript","https://ja.wikipedia.org/wiki/Python","https://ja.wikipedia.org/wiki/Java","https://github.com/marvin-we/steem-java-api-wrapper/wiki/How-to-add-SteemJ-to-your-project","https://github.com/marvin-we/steem-java-api-wrapper","https://ja.wikipedia.org/wiki/%E7%B5%B1%E5%90%88%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83","https://ja.wikipedia.org/wiki/IntelliJ_IDEA","https://steemit.com/@promari","https://steemit.com/@tamito0201/","https://www.programming-mariage.jp/","https://www.programming-mariage.jp","https://www.programming-mariage.jp/about"],"image":["https://img.esteem.ws/0k9qc2ta3w.png","https://img.esteem.ws/8kczj5iknd.png","https://img.esteem.ws/klez8dbwyr.png","https://img.esteem.ws/g3xd70ld2t.png","https://img.esteem.ws/a8px9bex48.png","https://img.esteem.ws/47sl1c5y86.png","https://ipfs.busy.org/ipfs/QmYQChjSnbGyuXBF36PYZ7dh59GzrVQguEZwoE9rnBJkaM","https://img.esteem.ws/btpb5hmlur.png","https://img.esteem.ws/omchy0nhkl.png"],"tags":["promari","programming","java","japanese","blog"],"app":"steemit/0.1","format":"markdown","community":"esteem.app"}
created2019-02-27 17:30:24
last_update2019-03-03 21:06:27
depth0
children1
last_payout2019-03-06 17:30:24
cashout_time1969-12-31 23:59:59
total_payout_value11.236 HBD
curator_payout_value3.330 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,316
author_reputation6,028,120,705,374
root_title"【Programming】Java Development vol.1 / SteemJを用いてJavaプログラムからSteem APIを実行する。"
beneficiaries
0.
accountesteemapp
weight1,000
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,499,226
net_rshares27,579,511,860,598
author_curate_reward""
vote details (654)
@steemitboard ·
Congratulations @promari! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@promari/payout.png?201902260908</td><td>You received more than 100 as payout for your posts. Your next target is to reach a total payout of 250</td></tr>
</table>

<sub>_[Click here to view your Board](https://steemitboard.com/@promari)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-promari-20190227t175948000z
categorypromari
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-02-27 17:59:48
last_update2019-02-27 17:59:48
depth1
children0
last_payout2019-03-06 17:59:48
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_length822
author_reputation38,975,615,169,260
root_title"【Programming】Java Development vol.1 / SteemJを用いてJavaプログラムからSteem APIを実行する。"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id80,500,204
net_rshares0