Get Twitter Feed as JSON without authentication

前端 未结 8 565
难免孤独
难免孤独 2021-01-30 18:16

I wrote a small JavaScript a couple of years ago that grabbed a users (mine) most recent tweet and then parsed it out for display including links, date etc.

It used this

8条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 18:41

    As you can see in the documentation, using the REST API you'll need OAuth Tokens in order to do this. Luckily, we can use the Search (which doesn't use OAuth) and use the from:[USERNAME] operator

    Example: http://search.twitter.com/search.json?q=from:marcofolio
    Will give you a JSON object with tweets from that user, where

    object.results[0]
    

    will give you the last tweet.

提交回复
热议问题