简体   繁体   中英

Twitter - Get users live tweets on my website instantly

I was checking out the stocktwits.com website. While signing up I provided them with my twitter username. Now whenever I tweet and if my tweet contains $ and a stock ticker symbol - it instantly appears on Stocktwits.com

I am interested in implementing something similar in my website. Just wanted an understanding of how this would work. This is how I'm assuming it would work at a high level:

1) On my website - require users to provide their twitter usernames 2) Run a cron job every few minutes to pull the latest tweets for each of the usernames provided using something like http://twitter.com/statuses/user_timeline/username.xml

I've tried Stocktwits and they updates are almost instantaneous - so it does not appear like they are checking for updates every few minutes.

  • What are the best ways to implement this solution Thanks

They are probably using Twitter's search API to search for $ sign. After that, if they want to show only twits from their users, all they need to do is filtering what they're showing with their user database.

If you don't want to do search queries every few minutes, you can use Twitter's Streaming API .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM