Twitterのプロフィールアイコンを1行で取得するGroovyスクリプト
tweetimag.es
- 取得URL
http://img.tweetimag.es/i/{username}_m http://img.tweetimag.es/i/{username}_n http://img.tweetimag.es/i/{username}_b http://img.tweetimag.es/i/{username}_o
- 例
- 1行で取得するGroovyスクリプト
new File("orange_clover.png") |< new URL("http://img.tweetimag.es/i/orange_clover_n").openStream()
サービス終了?
gadgtwit
- 取得URL
http://gadgtwit.appspot.com/twicon/{username} http://gadgtwit.appspot.com/twicon/{username}/mini http://gadgtwit.appspot.com/twicon/{username}/normal http://gadgtwit.appspot.com/twicon/{username}/bigger http://gadgtwit.appspot.com/twicon/{username}/original
- 例
- 1行で取得するGroovyスクリプト
new File("orange_clover.png") |< new URL("http://gadgtwit.appspot.com/twicon/orange_clover").openStream()
usericons
- 取得URL
http://usericons.relucks.org/twitter/{username}
- 例
以下のサービスのアイコンも習得可能
http://usericons.relucks.org/ を参照
- 1行で取得するGroovyスクリプト
new File("orange_clover.png") |< new URL("http://usericons.relucks.org/twitter/orange_clover").openStream()
dankogai 製
- 取得URL
http://api.dan.co.jp/twicon/{username}/mini http://api.dan.co.jp/twicon/{username}/normal http://api.dan.co.jp/twicon/{username}/bigger
- 例
- 1行で取得するGroovyスクリプト
new File("orange_clover.png") |< new URL("http://api.dan.co.jp/twicon/orange_clover/normal").openStream()
twicon
- 取得URL
http://www6.atpages.jp/mgngmgng/twicon?id={username} http://www6.atpages.jp/mgngmgng/twicon?id={username}&size=mini http://www6.atpages.jp/mgngmgng/twicon?id={username}&size=normal http://www6.atpages.jp/mgngmgng/twicon?id={username}&size=biggrer http://www6.atpages.jp/mgngmgng/twicon?id={username}&size=org
- 例
- 1行で取得するGroovyスクリプト
new File("orange_clover.png") |< new URL("http://www6.atpages.jp/mgngmgng/twicon?id=orange_clover&size").openStream()
Twitter4J + Groovyでダウンロード
This method should only be used by application developers to lookup or check the profile image URL for a user.
This method must not be used as the image source URL presented to users of your application.
永続的に表示しなきゃいいんだよね?違うか?
問題あれば削除します。
- 1行で取得するGroovyスクリプト
@Grab('org.twitter4j:twitter4j-core:[2.2.4,)') import twitter4j.* new File("orange_clover.png") |< new URL(new TwitterFactory().getInstance().getProfileImage("orange_clover", ProfileImage.NORMAL).URL).openStream()
- 例
ダウンロードしたものをはてなフォトにアップロードしてます
あれ、3行だったね