Twitter Streaming API

bonerton's picture

I'm looking to implement the twitter streaming api into a display board in quartz composer. I've used rss feeds before, and that's simple enough, but they're rate limited and i'm expecting a high volume of tweets. the streaming api is real-time and will keep a connection open indefinitely. the responses are returned in json format, and i've found a nifty patch on here that parses a json string into a qc structure, written by smorkis. I'm using the Kineme String to URL patch to make the call, then feeding that into smorkis json to structure patch. the only problem is the streaming api requires authentication, be it basic auth or OAuth, and i can't seem to pass credentials in the url, it just hangs QC. Any ideas?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

mattgolsen's picture
Re: Twitter Streaming API

Have you tried using HTTP authentication, http://username:password@yoururl.com ? I think I've successfully used that before in QC.

bonerton's picture
Re: Twitter Streaming API

yeah, i tried that but every time i do i get the beach ball of death and QC hangs. maybe it's working but the incoming stream is too much for it?

offonoll's picture
Re: Twitter Streaming API

boinx has one working very nice!

yanomano's picture
Re: Twitter Streaming API

Laserpilot posted a nice Twitter rss feed composition last year : http://kineme.net/composition/laserpilot/Twittersearchtermdisplayer

bonerton's picture
Re: Twitter Streaming API

checked out boinxtv, and without trying it, that seems like the functionality i'm after; now I just gotta figure out how to roll my own. thanks for the link yanomano, i'd checked it out before, and that's definitely a viable alternative. still need to authenticate with some methods of the REST api though, like the GET @mentions method, which i'm specifically trying to use. users would tweet @certain_account, the comp would pull from that account's @mentions and show only the 5 latest messages. would also like the message display to appear only when a new message is received. just thinking out loud here =]

bonerton's picture
Re: Twitter Streaming API

i still can't seem to pass authentication. I'm trying with the json method mentioned above, and also with the rss and xml patches. I thought it was working with the xml patch, but it returns something like an html page as a structure? I've sort of given up on the streaming api for now, and am at least trying to pass authentication and get mentions:

https://dev.twitter.com/docs/api/1/get/statuses/mentions

any info would be greatly appreciated

bonerton's picture
Re: Twitter Streaming API

what he said:

http://lists.apple.com/archives/quartzcomposer-dev/2010/Sep/msg00148.html

this shit is killing me. someone in the QC irc mentioned trying to handle the authentication locally via a proxy, but i'm not sure how hard that would be. there's also a list of libraries on the twitter dev site, but i'm not sure how i'd use them with QC:

https://dev.twitter.com/docs/twitter-libraries

usefuldesign.au's picture
Re: Twitter Streaming API

How are you going with this, boneton? I have a work-around idea today, if you can find some way of converting your twitter stream to a RSS Feed outside QC, then you could just use the RSS Patch to bring the structure in and parse it however you need inside QC.

How you convert a twitter stream to RSS Feed I've no idea but someone must have found a way out there.

mradcliffe's picture
Re: Twitter Streaming API

You probably want to look at the jsOauth library in the above link.

Could you use the jsOauth library as part of a js patch that takes the appropriate api information in and outputs a valid oauth request?

It also looks like Twitter has a Site Streams API (beta) now. I think if you use the filter query in the Streaming API it will work.