Hi, How would I go about combining multiple users twitter feeds into one list and display them on my page?
+1
A:
You'd have to go in, I'd say, three steps :
- Get the feed of each one of the users
- Those are available as RSS feeds ; for example : http://twitter.com/statuses/user_timeline/17907318.rss
- This means you can download it with
curl
, or download+read it withsimplexml_load_file
.
- When you have downloaded the feed for each user, and parsed it, you have several arrays of feeds.
- You'll have to merge those into a single array, containing all the feeds of all users ; see
array_merge
- And, then, probably sort that array by date ; see
usort
- You'll have to merge those into a single array, containing all the feeds of all users ; see
- And, finally, you'll have to display the resulting array, the way you want it.
As a sidenote : downloading several RSS feeds each time you want to display your resulting page is not a good idea : it will slow your site down a lot -- which means you need to put some caching mecanism in place :
- either cache the tweets data ; for example, using a MySQL database
- or cache the whole resulting portion of HTML code
Pascal MARTIN
2010-04-23 09:11:06
+1 for caching. From memory, Twitter may also block your site/application if you retrieve the user feeds more than X number of times an hour (I think!)
richsage
2010-04-26 22:17:41
A:
You can also create a list of the accounts you are interested in and place a list widget on your page. No PHP needed.
http://help.twitter.com/entries/76460-how-to-use-twitter-lists
abraham
2010-04-26 22:14:37