Twittered
Posted on 19. Apr, 2009 by Prlwytzkofsky in Robot
A small Flash application selectively consuming twitter posts, cobbled together on a Sunday afternoon while doing a little research into RESTful webservices. The app continuously searches Twitter for posts containing “I love” or “I hate” (inspired by the beautiful twistory site) using the AS3 G94 Circular Menu and Tweetr API.
EDIT April 20th 2009: Some people wanted a faster, others a slower Tweet refresh, so I have added a small knob which enables you to change the delay between tweet-refreshes between 0.7 and 10 seconds. It is visible when moving your mouse towards the centre of the circle, after which you can drag up and down to change its value (knob based on minimalcomps). Default value is 3 seconds.
Ironically, Twitters search API is different from its REST API, so my application doesn’t demonstrate the consumption of a REST service after all. Though I did learn that unknowingly I have been working with RESTful methods for as long as I have been working on the web: the World Wide Web is itself the key example of RESTful design!
The code for highlighting the love/hate phrases did take some sorting out, apparently you can only sort of simulate a highlight with a Colortransform, anyone know another way?
var pattern:RegExp=/i hate/i; var startnr:int = item.txt.text.search(pattern); item.txt.setSelection(startnr, startnr+6); item.txt.alwaysShowSelection=true; item.txt.transform.colorTransform=new ColorTransform(1,1,1,1,-75,-75,-75,0);


Justin
19. Apr, 2009
Good stuff!