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

in #promari5 years ago (edited)

Steem APIにはJavaScriptPythonJavaから呼び出すためのライブラリが公開されています。今回JavaプログラムからSteem APIを実行し、各種情報を表示したいと思います。

まず、以下のページに行き、JavaからSteem APIを呼び出すためのSteemJと呼ばれるライブラリをクローンします。

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

0k9qc2ta3w.png

クローンしたプロジェクトを統合開発環境(IDE)で開きます。ここではIntelliJ IDEAとしてプロジェクトを動作させたいと思います。

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

8kczj5iknd.png

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

klez8dbwyr.png

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

g3xd70ld2t.png

※赤枠の箇所を各自のアカウント情報に書き換えます。

試しにpromariのアカウントからフォロー情報を取得してみましょう。

a8px9bex48.png

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

47sl1c5y86.png

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

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

RGgukq5E6HBS5wrYDNU5euL5kWt6DCj2LPGHAqZSwkfuoLdEdH7eB2otBDVMtGomJ8P4VL5cKfjf69rtMbw4585DE9g1mLB8NZM7JXuMHuBBCgyw74nJcZCj8hD8Z6n.png
written by tamito0201

プログラミングとのご縁結びならプロマリへ。

オンラインプログラミング学習スクールのプロマリは、プログラミングの初学者の皆様を応援しています。プログラミング講師と一緒に面白いアプリを作りませんか。

btpb5hmlur.png

omchy0nhkl.png

The programming school "Promari" will help you learn programming. "Promari" is supporting the first scholars of programming. Let's develop an application with our programming instructor.

Sort:  

Congratulations @promari! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 100 as payout for your posts. Your next target is to reach a total payout of 250

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.28
TRX 0.13
JST 0.032
BTC 66304.34
ETH 2983.64
USDT 1.00
SBD 3.68