Twitter ?? Nashorn ????
- by Homma
?????
??? jlaskey ??? Nashorn Blog ????????????? https://blogs.oracle.com/nashorn/entry/nashorninthe_twitterverse ????????
??
Nashorn ?????????????????????????????????Project Nashorn ???????????Nashorn ?????????????????????Nashorn ????????????????????????????????????????????????????????????????????????????????????????????????????????
??????? Nashorn + Java ???????????????????Java ?? Twitter4J https://github.com/yusuke/twitter4j ?????????????????Twitter ?????????????????bin/getAccessToken.sh ?????twitter4j.properties ?????????????????????????????????
nashorn -cp $TWITTER4J/twitter4j-core-3.0.1.jar GetHomeTimeline.js
GetHomeTimeline.js ?????????
var twitter4j = Packages.twitter4j;
var TwitterFactory = twitter4j.TwitterFactory;
var Query = twitter4j.Query;
var twitter = new TwitterFactory().instance;
var query = new Query("nashorn OR nashornjs");
query.count = 100;
do {
var result = twitter.search(query);
var tweets = result.tweets;
for each (tweet in tweets) {
print("@" + tweet.user.screenName + "\t" + tweet.text);
}
} while (query = result.nextQuery());
?????????????? JavaFX ???????????????????????...