I'm using the Twitter-generated "Twitter Badge" HTML and JavaScript to show my Twitter feed on a web page. I'd like to include the replies to me in the same feed, or at least in another one. (My replies to others are already in there.) One the Twitter site, I just click on the @username link on the right panel and get the #replies for my userid. Does anybody know how to embed that in a page? Thanks.
+2
A:
There's an API method that will let you pull the 20 most recent @replies in XML or JSON format; however, it requires authentication, so you'll want to do this on the backend. (There are OAuth libraries for Javascript, but that doesn't sound especially workable to me for this use case.)
Meredith L. Patterson
2009-08-05 22:47:30
+1
A:
As long as you use twitter regularly enough to have tweets in search(expires after sometime), you could use twitter searches jsonp.
I wrote a simple js lib around it. http://gist.github.com/110884
That will give you an array of matching tweets that you can then style or whatever.
//done up in no framework js
Twitter.search({q:"alan",
callback:function(results){
var body = document.getElementsByTagName("body")[0];
for(var i=0;i<results.length;i++)
{
alert(results[i].text)
}
}
})
BaroqueBobcat
2009-08-05 23:55:18
No. Thanks; I'll check that out immediately.
Alan
2009-08-07 16:40:53
Like @BaroqueBobcat's suggestion, Juitter -- which is pretty cool, I must say -- relies on search. I was looking for direct timeline data: tweets by a given user id (me) and all the @replies to it. That way the data persists longer than in search. I think I shall have to write something myself using the API.
Alan
2009-08-07 18:02:36