Peter Elst

Flash Platform Consultant
  • Home
  • About me
  • Articles
  • Downloads
  • Contact me

Twitter API

10 02 2007

Twitter has rapidly become my new addiction — its a really cool way to stay in touch with friends and if you turn off text message notification and use something like twitterific I’ve found it is actually quite usable.

One thing I just don’t get is the AS2 and AS3 libraries they released, instead of simply parsing your RSS feed for messages it uses a JSON parser class. Talk about overhead — that doesn’t make any sense to me. This is one of those situations where they try to shoehorn an AJAX approach onto Flash. The example FLA that comes with the library also has code embedding your twitter username and password to get hold of your friends timeline.

While I understand they want to keep the example easy to read and understand, that’s not a smart move! How easy is it to decompile a SWF, get hold of account details and start spamming away?

If you need to do anything other than what the RSS feeds can get you, I’d really recommend using a server-side script to proxy the calls rather than running the risk of exposing your account details client-side.

www.twitter.com

« Crossbreeding Web and Desktop Scorpio is top notch »



Actions

  • rss Comments rss
  • trackback Trackback

Informations

  • Date : 10 February 2007
  • Categories : Rants

10 responses to “Twitter API”

10 02 2007
Aral Balkan (14:22:57) :

Flash developers have to understand that any information in a SWF should be treated as public. Yes, the SWF needs to be decompiled but there are many tools out there that make this a trivial task. Treat the Flash client as you would HTML. You wouldn’t embed your username/password in plain text in an HTML file so don’t in a SWF. (Maybe we need to write a DevNet article on this, what do you think?)

Of course Macromedia didn’t help things by actually *pushing* this practice first with the FireFly components and then the various Connector components in Flash, fueled by the “you can create an app in five minutes” marketing campaign.

Great to see you on Twitter, btw! :)

10 02 2007
Peter (23:54:02) :

yup very true Aral, they should have an article up on that — I’ve seen more than just a few Flash widgets that open up security issues because they embed login details.

11 02 2007
Jim Rutherford (06:43:37) :

Although the Twitter API AS3 class uses thier JSON feeds, it is rather trivial to modify the class to load their XML feeds then use E4X to grab the data you want. Once you change the feeds, you can drop the Adobe JSON class!

The thing I found odd when working with their API, is that the XML and JSON data returned by their API’s do not contain the same data structure. The JSON data is missing many fields that are contained in the XML version.

21 02 2007
Ray (04:02:55) :

Hey Peter, I am the Flash developer for Twitter. The authentication features of the API should be used with discretion. While I agree that developers should not be distributing badges that expose a users username and password, I am not so sure about your argument against using JSON. The choice to use JSON was not an Ajax thing, more about going with the data format I feel most comfortable with. Instead of parsing the XML, I preferred receiving the data in a format was simply ready to go.

24 02 2007
Aral Balkan (12:00:26) :

Hi Ray,

I guess if you’re going with AS2, XML and/or JSON isn’t an issue. Although for AS3, I don’t see why I would personally favor JSON over XML since we have E4X.

I’ve been thinking about this a bit recently and I can definitely see the elegance of JSON for JavaScript. One eval (for a trusted data source) and you’re off. Keeping the data format in the actual language itself is wonderful for its lack of overhead. It does strike me as weird though to have to parse JavaScript in another language (I wish we had the same sort of eval in AS3 — now that would rock since the structure would translate natively).

I’m actually thinking of a similar data exchange format for Flash. Need to do some tests first…

Also: Is there a call I can make to get status updates since a certain time (e.g., pass a timestamp and get the updates that have happened for an user or user with friends since that time?)

Thanks!

27 02 2007
Ray (01:47:35) :

Yes, you are right about using JSON vs. A4X. I actually wrote the libary for AS2 first and then moved it over to AS3 before I was aware of A4X. We are adding some new features to the API and there will be a new library soon. We are actually deploying some new stuff today that will allow you get the updates since a given time. I’ll let you know once that is in there.

27 02 2007
Ray (01:54:54) :

er.. I mean E4X

14 03 2007
Austin Marshall (21:11:56) :

I can’t seem to get the Twitter AS3 classes to successfully authenticate. If I connect to a local proxy which handles the authentication (which seems ideal at this point), it works like a charm. For whatever reason, the Authenticate header isn’t being received.

Are there any working examples in the wild I might be able to look at?

30 03 2007
Gareth (10:59:41) :

All this talk of security am I really concerned if someone steals my Twitter login people have more of a life than this. And If i am using my regular email details or something like that well thats just plain dumb.

30 03 2007
Peter (11:12:06) :

we’re not just talking ‘real’ people Gareth — the process could easily be automated by spam bots and make life hell on twitter.

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>





Conferences

Flash on the Beach Speaker

Training Partners

multimediacollege

SkillsMatter

  • Categories

    • AIR RSS category feed
    • Ajax RSS category feed
    • CSS RSS category feed
    • Eclipse RSS category feed
    • Events RSS category feed
    • Flash RSS category feed
    • Flash Lite RSS category feed
    • Flex RSS category feed
    • Gadgets RSS category feed
    • General RSS category feed
    • JSFL RSS category feed
    • Mac RSS category feed
    • Open Source RSS category feed
    • PHP RSS category feed
    • Podcasts RSS category feed
    • Publications RSS category feed
    • Rants RSS category feed
    • Reviews RSS category feed
    • Thought of the Day RSS category feed
    • Training RSS category feed
    • Twitter RSS category feed
    • Video RSS category feed
  • Resources

    • Sas Jacobs
    • Darron Schall
    • Brajeshwar Oinam
    • Francis Bourre
    • Aral Balkan
    • Burak Kalayci
    • Scott Barnes
    • Branden Hall
    • Jesse Warden
    • Stephen Downs
    • Simon Barber
    • Guy Watson
    • Rich Tretola
    • Mario Klingemann
    • Marco Casario
    • Patrick Mineault
    • Owen van Dijk
    • Abdul Qabiz
    • AndrĂ© Michelle
    • Serge Jespers

     
     

    Adobe Community Expert

    See my profile on LinkedIn



    Harz Ferienwohnung Suchmaschinenoptimierung Geschenkideen Harz Ferienwohnung Pagerank Webkatalog Webhosting