Here's how.
You will need:
- The R environment for statistics and graphics (www.r-project.org)
- The twitteR and brew packages for R
- Some web space
twitline <- function(q,outfile,num=15,...){Now all I do is: twitline("sea otters","twitter.xml",num=100) and I get an XML file in the right format. Read the timeline docs and you'll see that all you need is:
require(twitteR)
require(brew)
srch=searchTwitter(q,num=num,...)
brewSrc="
<% for(tweet in srch){ %>\\"
title=\"<%=screenName(tweet) %>\">
<%=text(tweet) %>
<% } %>
"
brew(text=brewSrc,output=outfile)
}
Timeline.loadXML("twitter.xml", function(xml, url) { eventSource.loadXML(xml, url); });in the right place in your javascript.
There's a few things need doing here, like scaling the timeline to the events on startup, maybe styling things a bit better, having a way to get more than 100 tweets, linking to twitter.com and so on. Consider it a start.
Also, the grabbing and conversion could easily be done in Python or [IYFPLH]. Even cooler would be on-the-fly updates. Check out the SIMILE docs for more ideas.
Barry
Your post is very informative. waiting for your next post.
ReplyDeletegeorectification services