/ Published in: ActionScript 3
URL: http://code.google.com/p/swx-format/
I've tried RSS, ATOM, JSON, XML (with a Python Proxy), and so far this is my preferred way to access my Twitter Public Timeline. The project requires you to download the SWX which you can find on Google Code
Expand |
Embed | Plain Text
package { import flash.display.Sprite; import org.swxformat.SWX; public class main extends Sprite { //http://apiwiki.twitter.com/SWX+Twitter+API public static const SWX_PUBLIC_GATEWAY:String = "http://www.swxformat.org/php/swx.php"; private var currentImage:Number = 0; private var maxImages:Number = 10; private var swx:SWX; public function main() { swx = new SWX() swx.gateway = SWX_PUBLIC_GATEWAY; swx.encoding = "GET"; var twitterRequest:Object = { serviceClass: "Twitter", method: "userTimeline", timeout: 5, //debug: true, resultHandler: resultHandler, progressHandler: progressHandler, timeoutHandler: timeoutHandler, faultHandler: faultHandler, //[ "user", "password", "userId", "limit", "since"] args: [ "chrisaiv", "******", "", "10" ] }; swx.call( twitterRequest ); } private function progressHandler( e:Object ):void { //trace( "progressHandler: " + e.bytesLoaded / e.bytesTotal ); } private function timeoutHandler( e:Object ):void { trace( "timeoutHandler: " ); } private function faultHandler( e:Object ):void { trace( "faultHandler: " + e ); } private function resultHandler( e:Object ):void { var data:Array = e.result as Array; for( var i:Number = 0; i < data.length; i++ ){ var info:Object = data[i] as Object; trace( "Published: ", info.created_at, "Text:", info.text, "Avatar:", info.user.profile_image_url, "User:", info.user.screen_name ); } } } }
You need to login to post a comment.
