チェンジセット 1874
- コミット日時:
- 2008/11/19 09:03:20 (2 ヶ月前)
- ファイル:
-
- air/TLife/TLife.as3proj (更新) (2 diffs)
- air/TLife/bin/TLife.swf (更新) (変更前)
- air/TLife/obj/TLifeConfig.old (更新) (1 diff)
- air/TLife/obj/TLifeConfig.xml (更新) (1 diff)
- air/TLife/src/Main.as (削除)
- air/TLife/src/Main.mxml (追加)
- air/TLife/src/uwi/bean/Status.as (更新) (1 diff)
- air/TLife/src/uwi/bean/StatusGetter.as (更新) (2 diffs)
- air/TLife/src/uwi/thread/MainThread.as (更新) (3 diffs)
- air/TLife/src/uwi/thread/TwitterLoginThread.as (更新) (2 diffs)
- air/TLife/src/uwi/thread/TwitterPostThread.as (追加)
- air/TLife/src/uwi/thread/TwitterReloadThread.as (追加)
- air/TLife/src/uwi/util/Components.as (追加)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/TLife.as3proj
r1873 r1874 55 55 <intrinsics> 56 56 <element path="Library\AS3\frameworks\AIR" /> 57 <element path="Library\AS3\frameworks\Flex3" /> 57 58 </intrinsics> 58 59 <!-- Assets to embed into the output SWF --> … … 62 63 <!-- Class files to compile (other referenced classes will automatically be included) --> 63 64 <compileTargets> 64 <compile path="src\Main. as" />65 <compile path="src\Main.mxml" /> 65 66 </compileTargets> 66 67 <!-- Paths to exclude from the Project Explorer tree --> air/TLife/obj/TLifeConfig.old
r1873 r1874 16 16 </compiler> 17 17 <file-specs> 18 <path-element>E:\flash\TLife\src\Main. as</path-element>18 <path-element>E:\flash\TLife\src\Main.mxml</path-element> 19 19 </file-specs> 20 20 <default-background-color>#FFFFFF</default-background-color> air/TLife/obj/TLifeConfig.xml
r1873 r1874 16 16 </compiler> 17 17 <file-specs> 18 <path-element>E:\flash\TLife\src\Main. as</path-element>18 <path-element>E:\flash\TLife\src\Main.mxml</path-element> 19 19 </file-specs> 20 20 <default-background-color>#FFFFFF</default-background-color> air/TLife/src/uwi/bean/Status.as
r1873 r1874 21 21 public function get Voice() : String { return voice; } 22 22 public function get VoiceID() : String { return voiceid; } 23 public function get Content() : String { return content; } 23 24 public function get PostedTime() : Date { return postedtime; } 24 25 } air/TLife/src/uwi/bean/StatusGetter.as
r1873 r1874 1 1 package uwi.bean { 2 import mx.formatters.DateFormatter; 3 import uwi.util.Components; 2 4 import uwi.util.StringUtility; 3 5 … … 11 13 var ret : Vector.<Status> = new Vector.<Status>(); 12 14 15 trace("src : " + src); 16 13 17 var pinched : Vector.<String> = StringUtility.pinchAll(src, "<tr id=\"status_", "</tr>"); 18 trace("pinched : " + pinched.length); 14 19 for each(var str : String in pinched) { 15 20 ret.push(extract(str)); air/TLife/src/uwi/thread/MainThread.as
r1873 r1874 1 1 package uwi.thread { 2 2 import flash.display.Stage; 3 import flash.net.URLRequest ;3 import flash.net.URLRequestDefaults; 4 4 import flash.text.TextField; 5 import mx.collections.ArrayCollection; 5 6 import org.libspark.thread.Thread; 6 import org.libspark.thread.threads.net.URLLoaderThread;7 7 import org.libspark.thread.utils.SerialExecutor; 8 import uwi.bean.Status; 9 import uwi.bean.StatusGetter; 10 import uwi.util.FileIO; 8 import uwi.util.Components; 11 9 12 10 /** … … 15 13 */ 16 14 public class MainThread extends Thread { 15 private var components : Components; 17 16 private var stage : Stage; 18 17 private var tuet : TinyURLEncodeThread; 19 18 private var tudt : TinyURLDecodeThread; 20 private var tf : TextField;21 private var ult : URLLoaderThread;22 19 23 public function MainThread(stage : Stage ) {20 public function MainThread(stage : Stage, components : Components) { 24 21 this.stage = stage; 22 this.components = components; 25 23 } 26 24 27 25 protected override function run() : void 28 26 { 29 tf = new TextField();30 tf.width = 200;31 tf.height = 200;32 tf.text = "きみだけをー\n";33 stage.addChild(tf);34 27 // http://tinyurl.com/8wz 35 28 //tuet = new TinyURLEncodeThread("http://www.google.co.jp"); … … 40 33 //tudt.join(); 41 34 42 var src : String = FileIO.readAll("d:\\twitter\\ssrc.html", "UTF-8");43 var statuses : Vector.<Status> = StatusGetter.get(src);35 //var src : String = FileIO.readAll("d:\\twitter\\ssrc.html", "UTF-8"); 36 //var statuses : Vector.<Status> = StatusGetter.get(src); 44 37 45 //var se : SerialExecutor = new SerialExecutor(); 46 //se.addThread(new TwitterLoginThread("uwitenpen", "kusoyonn")); 47 //ult = new URLLoaderThread(new URLRequest("http://twitter.com/home")); 48 //se.addThread(ult); 49 //se.start(); 50 //se.join(); 51 52 // next(encodeCompleted); 53 } 54 55 private function encodeCompleted() : void 56 { 57 tf.appendText(ult.loader.data); 38 var se : SerialExecutor = new SerialExecutor(); 39 se.addThread(new TwitterLoginThread("muwi", "mugicha")); 40 se.addThread(new TwitterReloadThread(components)); 41 // se.addThread(new TwitterPostThread("てすとにゃ")); 42 URLRequestDefaults.setLoginCredentialsForHost("twitter.com", "muwi", "mugicha"); 43 se.start(); 44 se.join(); 58 45 } 59 46 air/TLife/src/uwi/thread/TwitterLoginThread.as
r1873 r1874 1 1 package uwi.thread { 2 import flash.events.HTTPStatusEvent; 2 3 import flash.net.URLRequest; 3 4 import flash.net.URLRequestMethod; 5 import mx.controls.Alert; 4 6 import org.libspark.thread.Thread; 5 7 import org.libspark.thread.threads.net.URLLoaderThread; … … 30 32 ult.start(); 31 33 ult.join(); 34 event(ult.loader, HTTPStatusEvent.HTTP_RESPONSE_STATUS, onResponse); 35 error(Error, onError); 32 36 } 33 37 38 private function onError(e : Error, t : Thread) : void 39 { 40 trace(e.getStackTrace()); 41 } 42 43 private function onResponse(event : HTTPStatusEvent) : void 44 { 45 if (event.status == 401) { 46 Alert.show("Login Failed!", "Login"); 47 trace("login failed!"); 48 } 49 } 34 50 } 35 51
