forked from: Yahoo!Pipesでtwitter簡易ビューア

by tepe forked from Yahoo!Pipesでtwitter簡易ビューア (diff: 1)
Yahoo! Pipesを使って、
twitterのログを読んでみるテスト。
自動リロードなどの機能はありません。
書き込みもできません。
フォローしている人の投稿も読めません。
はじめてのYahoo! Pipesなのです。

Pipesってホントに良くできているね。すごい。

ちなみに僕はほとんどtwitterに書き込まないので、
フォローしても良いこと無いと思うよ。
♥0 | Line 59 | Modified 2012-02-13 15:22:29 | MIT License
play

ActionScript3 source code

/**
 * Copyright tepe ( http://wonderfl.net/user/tepe )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ucqAG
 */

// forked from umhr's Yahoo!Pipesでtwitter簡易ビューア
/*
Yahoo! Pipesを使って、
twitterのログを読んでみるテスト。
自動リロードなどの機能はありません。
書き込みもできません。
フォローしている人の投稿も読めません。
はじめてのYahoo! Pipesなのです。


Pipesってホントに良くできているね。すごい。


ちなみに僕はほとんどtwitterに書き込まないので、
フォローしても良いこと無いと思うよ。
*/
package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.text.TextField;
    [SWF(width = "465", height = "465", backgroundColor = 0xFFFFFF, frameRate = "30")]
    public class Main extends Sprite{
        private var userName:TextField = new TextField();
        private var tf:TextField = new TextField();
        public function Main() {
            var button:Sprite = new Sprite();
            button.graphics.lineStyle (2, 0x999999, 1.0);
            button.graphics.beginFill (0xCCCCCC, 1.0);
            button.graphics.drawRoundRect (200, 2 , 100 , 23 , 10 , 10);
            button.buttonMode = true;
            addChild(button);
            button.addEventListener(MouseEvent.CLICK,CLICK);
            userName.x = 2;
            userName.y = 2;
            userName.width = 196;
            userName.height = 21;
            userName.border = true;
            userName.type = "input";
            userName.text = "umhr";
            addChild(userName);
            var userIDText:TextField = new TextField();
            userIDText.x = 300;
            userIDText.y = 6;
            userIDText.width = 170;
            userIDText.height = 21;
            userIDText.text = "<-- change UserID";
            userIDText.selectable = false;
            addChild(userIDText);
            CLICK();
        }
        
        private function CLICK(e:MouseEvent = null):void {
            var loader:URLLoader = new URLLoader();
            loader.addEventListener(Event.COMPLETE, COMPLETE);
            var pipesURL:String = "http://pipes.yahooapis.com/pipes/pipe.run?_id=92416843789c0b7f9a0d0fbfe0aa54c6&_render=rss&statustitle="+userName.text+"&username="+userName.text;
            loader.load(new URLRequest(pipesURL));
        }
        
        private function COMPLETE(e:Event):void {
            var list:XML = new XML(e.currentTarget.data);
            var _length:int = list.channel.item.length();
            var txt:String = "";
            for (var i:int = 0; i < _length; i++) {
                txt += String(list.channel.item[i].description) + "\r"
            }
            tf.y = 30;
            tf.width = stage.stageWidth;
            tf.height = stage.stageHeight;
            tf.wordWrap = true;
            tf.htmlText = txt;
            addChild(tf);
        }
    }
}