开发者

How to simply read tweets from any twitter user? (without loggin on twitter)

I am 开发者_高级运维trying to read tweets from a dinamically given twitter user in a Android app.

I found here (stackoverflow) and at google some ways to connect to twitter, but i didn't find a simply way to obtain the tweets of a given user without a loggin on twitter. I found some ways to do something similar with java, but using license protected librarys, and also i need to know the specific way with android (not java), without using license protected librarys.

There is a way to do it?


Don't bother using libraries, just grab the data from the web.

  • JSON: https://api.twitter.com/1/statuses/user_timeline.json?screen_name=barackobama
  • XML: https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=barackobama

Just replace screen_name with any non-protected user and it'll work.


Use Twitter4j library and the "Search for tweets" example. You will not need to log in, just put the username whose tweets you want to read in the query and that's it.

Another way, if you dont want to use specific libraries, would be parsing the twitter page, with HtmlParser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜