チェンジセット 2200
- コミット日時:
- 2009/01/31 17:21:11 (3 年前)
- ファイル:
-
- air/TLife/bin/TLife.swf (更新) (変更前)
- air/TLife/src/uwi/bean/Status.as (更新) (2 diffs)
- air/TLife/src/uwi/db/DB.as (更新) (1 diff)
- air/TLife/src/uwi/db/SimpleTransactionThread.as (更新) (2 diffs)
- air/TLife/src/uwi/thread/ContextMenuItemEventThread.as (更新) (3 diffs)
- air/TLife/src/uwi/thread/DataGridEventThread.as (更新) (6 diffs)
- air/TLife/src/uwi/thread/DataGridRoutineThread.as (更新) (4 diffs)
- air/TLife/src/uwi/thread/FrameTimerThread.as (更新) (1 diff)
- air/TLife/src/uwi/thread/HTMLLoaderThread.as (更新) (1 diff)
- air/TLife/src/uwi/thread/ReplyGetThread.as (更新) (2 diffs)
- air/TLife/src/uwi/thread/StatusInsertThread.as (更新) (3 diffs)
- air/TLife/src/uwi/thread/TimelineThread.as (更新) (1 diff)
- air/TLife/src/uwi/twitter/TwitterBitStatusGetThread.as (更新) (4 diffs)
- air/TLife/src/uwi/twitter/TwitterLoginThread.as (更新) (2 diffs)
- air/TLife/src/uwi/twitter/TwitterPostThread.as (更新) (3 diffs)
- air/TLife/src/uwi/twitter/TwitterReloadThread.as (更新) (1 diff)
- air/TLife/src/uwi/util/CommonData.as (更新) (2 diffs)
- air/TLife/src/uwi/util/StatusDOMScraper.as (更新) (3 diffs)
凡例:
- 変更無し
- 追加
- 削除
- 更新
- コピー
- 移動
air/TLife/src/uwi/bean/Status.as
r2183 r2200 14 14 private var _iconurl : String; // iconのURL 15 15 private var _fav : Boolean; 16 private var _tag : String; 16 17 17 18 public function Status(postid : String, postername : String, posterid : String, content : String, replyid : String, postedtime : Date, iconurl : String, fav : Boolean) { … … 93 94 } 94 95 96 public function get tag():String { return _tag; } 97 98 public function set tag(value:String):void 99 { 100 _tag = value; 101 } 102 95 103 } 96 104 air/TLife/src/uwi/db/DB.as
r2183 r2200 46 46 ")"); 47 47 execute(conn, 48 "create table if not exists " + CommonData.TABLE_ FOLLOWING+ "(" +48 "create table if not exists " + CommonData.TABLE_RELATION + "(" + 49 49 "userid varchar(15) not null," + 50 50 "posterid varchar(15) not null," + 51 "following boolean not null," + 52 // "followed boolean not null," + 53 "protected boolean not null," + 54 "lastupdated date not null," + 51 55 "primary key(userid, posterid)" + 52 56 ")"); 53 54 57 } 55 58 air/TLife/src/uwi/db/SimpleTransactionThread.as
r2139 r2200 15 15 private var args : Array; // Array<Object> 16 16 17 public function SimpleTransactionThread(conn : SQLConnection, basetext : String, args : Array )17 public function SimpleTransactionThread(conn : SQLConnection, basetext : String, args : Array = null) 18 18 { 19 19 super(conn); … … 34 34 stmt.text = basetext; 35 35 36 for each(var obj : Object in args) { 37 for (var key : String in obj) { 38 stmt.parameters[key] = obj[key]; 36 if (args != null) { 37 for each(var obj : Object in args) { 38 for (var key : String in obj) { 39 stmt.parameters[key] = obj[key]; 40 } 41 try { 42 stmt.execute(); 43 }catch (e : SQLError) { 44 trace(e.message); 45 } 39 46 } 47 }else { 40 48 try { 41 49 stmt.execute(); air/TLife/src/uwi/thread/ContextMenuItemEventThread.as
r2183 r2200 207 207 } 208 208 209 /** 210 * TODO protectedな相手をfollowするときのrequest 211 * @param e 212 */ 209 213 private function onFollow(e : ContextMenuEvent) : void 210 214 { … … 217 221 } 218 222 var pe : ParallelExecutor = new ParallelExecutor(); 223 var now : Date = new Date(); 219 224 pe.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, 220 " insert into " + CommonData.TABLE_FOLLOWING + " (userid, posterid) values ('" + CommonData.configxml.userid + "', :posterid",225 "replace into " + CommonData.TABLE_RELATION + " (userid, posterid, following, protected, lastupdated) values ('" + CommonData.configxml.userid + "', :posterid, true, false, '" + now + "')", 221 226 args)); 222 227 pe.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, 223 " insert into " + CommonData.TABLE_FOLLOWING + " (userid, posterid) values ('" + CommonData.configxml.userid + "', :posterid",228 "replace into " + CommonData.TABLE_RELATION + " (userid, posterid, following, protected, lastupdated) values ('" + CommonData.configxml.userid + "', :posterid, true, false, '" + now + "')", 224 229 args)); 225 230 pe.start(); … … 239 244 var pe : ParallelExecutor = new ParallelExecutor(); 240 245 pe.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, 241 "delete from " + CommonData.TABLE_ FOLLOWING + " whereposterid = :posterid",246 "delete from " + CommonData.TABLE_RELATION + " where userid = '" + CommonData.configxml.userid + "' and posterid = :posterid", 242 247 args)); 243 248 pe.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, 244 "delete from " + CommonData.TABLE_ FOLLOWING + " whereposterid = :posterid",249 "delete from " + CommonData.TABLE_RELATION + " where userid = '" + CommonData.configxml.userid + "' and posterid = :posterid", 245 250 args)); 246 251 pe.start(); air/TLife/src/uwi/thread/DataGridEventThread.as
r2199 r2200 40 40 event(dg, Event.CHANGE, onChange); 41 41 event(dg, KeyboardEvent.KEY_DOWN, onKeyDown); 42 event(dg, KeyboardEvent.KEY_UP, onKeyUp);43 42 event(dg, ScrollEvent.SCROLL, onScroll); 44 43 } … … 46 45 private function onScroll(e : ScrollEvent) : void 47 46 { 48 dgrt.flag = 1; 47 trace("scroll"); 48 dgrt.flag |= 1; 49 49 next(run); 50 50 } … … 81 81 private function onKeyDown(e : KeyboardEvent) : void 82 82 { 83 trace("down"); 83 84 if (dg.selectedIndex != -1){ 84 85 switch(e.keyCode) { … … 86 87 dg.selectedIndex = searchSamePoster(dg.selectedIndex, 1); 87 88 dg.scrollToIndex(dg.selectedIndex); 88 dgrt.flag = 2;89 dgrt.flag |= 3; 89 90 break; 90 91 case Keyboard.LEFT: 91 92 dg.selectedIndex = searchSamePoster(dg.selectedIndex, -1); 92 93 dg.scrollToIndex(dg.selectedIndex); 93 dgrt.flag = 2;94 dgrt.flag |= 3; 94 95 break; 96 // up,downでscrollした場合、changeが打ち消されるため 95 97 case Keyboard.UP: 96 98 case Keyboard.DOWN: 97 dgrt.flag = 2;99 dgrt.flag |= 3; 98 100 break; 99 101 default: … … 102 104 dgrt.suspended = true; 103 105 } 104 next(run); 106 event(dg, KeyboardEvent.KEY_UP, onKeyUp); 107 // next(run); 105 108 } 106 109 107 110 private function onKeyUp(e : KeyboardEvent) : void 108 111 { 112 trace("up"); 109 113 dgrt.suspended = false; 110 114 next(run); … … 117 121 public function onChange(e : Event) : void 118 122 { 119 dgrt.flag = 2; 123 trace("change"); 124 dgrt.flag |= 3; 120 125 next(run); 121 126 } air/TLife/src/uwi/thread/DataGridRoutineThread.as
r2199 r2200 39 39 { 40 40 if (flag == 0 || suspended) return; 41 trace("flag : " + flag); 41 42 42 43 var obj : Object = dg.selectedItem; … … 46 47 } 47 48 var index : int = dg.selectedIndex; 48 49 switch(flag) { 50 case 2: 49 50 if((flag & 2) != 0){ 51 51 // friendpost欄に表示 52 52 friendname.text = obj.postername + " / " + obj.posterid; … … 69 69 CommonData.rgt.start(); 70 70 } 71 72 case 1: 71 } 72 73 if((flag & 1) != 0){ 73 74 // 背景色変更 74 75 var len : int = CommonData.timeline.length - dg.maxVerticalScrollPosition + 1; … … 87 88 } 88 89 } 89 break;90 91 default:92 break;93 90 } 94 91 flag = 0; air/TLife/src/uwi/thread/FrameTimerThread.as
r2199 r2200 31 31 } 32 32 next(repeated); 33 error(Error, onError); 34 } 35 36 private function onError(e : Error, t : Thread) : void 37 { 38 trace(e.getStackTrace()); 39 next(repeated); 33 40 } 34 41 air/TLife/src/uwi/thread/HTMLLoaderThread.as
r2199 r2200 17 17 public function HTMLLoaderThread(req : URLRequest, html : HTMLLoader = null) 18 18 { 19 if (_html == null) _html = new HTMLLoader(); 19 if (html != null) { 20 _html = html; 21 }else { 22 _html = new HTMLLoader(); 23 } 20 24 _req = req; 21 25 } air/TLife/src/uwi/thread/ReplyGetThread.as
r2199 r2200 39 39 protected override function run() : void 40 40 { 41 checkRelation(); 42 } 43 44 private function checkRelation() : void 45 { 41 46 retryct++; 47 var sql : String = "select lastupdated from " + 48 CommonData.TABLE_RELATION + 49 " where userid = '" + CommonData.configxml.userid + "'" + 50 " and posterid = '" + posterid + "'" + 51 " and protected = true"; 52 dbst = new DBSelectThread(CommonData.db_disk.conn, sql); // _disk? 53 dbst.start(); 54 dbst.join(); 55 next(checkStatus); 56 } 57 58 private function checkStatus() : void 59 { 42 60 var sql : String = "select postid, posterid, content, postedtime, replyid, fav from " + 43 61 CommonData.TABLE_STATUS + … … 60 78 tbsgt.start(); 61 79 tbsgt.join(); 62 next( run);80 next(checkRelation); 63 81 } 64 82 }else { air/TLife/src/uwi/thread/StatusInsertThread.as
r2199 r2200 20 20 * @param conn 21 21 * @param statuses 22 * @param following followingが確定しているかどうか。falseの場合は poster上のfollowingの値を変えない。 未実装22 * @param following followingが確定しているかどうか。falseの場合はfollowingの値を変えない。 未実装 23 23 */ 24 24 public function StatusInsertThread(conn : SQLConnection, statuses : Vector.<Status>, following : Boolean) { … … 26 26 this.statuses = statuses; 27 27 this.following = following; 28 29 // 時間昇順にソート30 statuses.sort(function(x : Status, y : Status) : Number {31 return x.postedtime.getTime() - y.postedtime.getTime();32 });33 28 } 34 29 … … 87 82 if (following) { 88 83 trace("INSERT3"); 84 var now : Date = new Date(); 89 85 var stmt_rep_following : SQLStatement = new SQLStatement(); 90 86 stmt_rep_following.sqlConnection = conn; 91 stmt_rep_following.text = "replace into " + CommonData.TABLE_ FOLLOWING + " (userid, posterid) values (:userid, :posterid)";87 stmt_rep_following.text = "replace into " + CommonData.TABLE_RELATION + " (userid, posterid, following, protected, lastupdated) values (:userid, :posterid, true, false, :lastupdated)"; 92 88 93 89 for (key in postermap) { 94 90 stmt_rep_following.parameters[":userid"] = CommonData.configxml.userid.toString(); 95 91 stmt_rep_following.parameters[":posterid"] = key; 92 stmt_rep_following.parameters[":lastupdated"] = now; 96 93 try { 97 94 stmt_rep_following.execute(); air/TLife/src/uwi/thread/TimelineThread.as
r2199 r2200 47 47 CommonData.TABLE_STATUS; 48 48 var condfollowing : String = " where posterid in (select posterid from " + 49 CommonData.TABLE_FOLLOWING + 50 " where userid = '" + CommonData.configxml.userid + "')"; 49 CommonData.TABLE_RELATION + 50 " where userid = '" + CommonData.configxml.userid + "'" + 51 " and following = true)"; 51 52 var sql : String = null; 52 53 if (query != null) { air/TLife/src/uwi/twitter/TwitterBitStatusGetThread.as
r2199 r2200 6 6 import org.libspark.thread.utils.ParallelExecutor; 7 7 import uwi.bean.Status; 8 import uwi.db.SimpleTransactionThread; 8 9 import uwi.thread.HTMLLoaderThread; 9 10 import uwi.thread.LinkResolveThread; … … 22 23 private var pe : ParallelExecutor = null; 23 24 24 private var s : Status ;25 private var s : Status = null; 25 26 26 27 private var posterid : String; … … 45 46 private function onGetComplete() : void 46 47 { 47 s = StatusDOMScraper.scrapeBit(hlt.html); 48 lrt = new LinkResolveThread(s.content); 49 lrt.start(); 50 lrt.join(); 51 next(resolveComplete); 48 trace("getcomplete"); 49 var ret : Object = StatusDOMScraper.scrapeBit(hlt.html); 50 if (ret.code == 1) { 51 // protected 52 pe = new ParallelExecutor(); 53 var now : Date = new Date(); 54 pe.addThread(new SimpleTransactionThread(CommonData.db_memory.conn, 55 "replace into " + CommonData.TABLE_RELATION + " (userid, posterid, following, protected, lastupdated) values ('" + CommonData.configxml.userid + "', '" + posterid + "', false, true, '" + now + "')")); 56 pe.addThread(new SimpleTransactionThread(CommonData.db_disk.conn, 57 "replace into " + CommonData.TABLE_RELATION + " (userid, posterid, following, protected, lastupdated) values ('" + CommonData.configxml.userid + "', '" + posterid + "', false, true, '" + now + "')")); 58 pe.start(); 59 pe.join(); 60 }else { 61 s = ret.status; 62 lrt = new LinkResolveThread(s.content); 63 lrt.start(); 64 lrt.join(); 65 next(resolveComplete); 66 } 52 67 interrupted(onInterrupted); 53 68 } … … 55 70 private function resolveComplete() : void 56 71 { 72 trace("resolvecomplete"); 57 73 s.content = lrt.dst; 58 74 var v : Vector.<Status> = Vector.<Status>([s]); air/TLife/src/uwi/twitter/TwitterLoginThread.as
r2183 r2200 6 6 import org.libspark.thread.Thread; 7 7 import org.libspark.thread.threads.net.URLLoaderThread; 8 import uwi.util.CommonData; 8 9 import uwi.util.StatusBarUtility; 9 10 … … 74 75 { 75 76 trace("response : " + event.status); 76 if (event.status == 401) { 77 Alert.show("ログインできなかたー", "Login"); 77 if (event.status == 200) { 78 StatusBarUtility.write("ログイン成功!"); 79 }else{ 80 Alert.show(CommonData.TWITTER_RESPONSE[event.status], "Login"); 78 81 StatusBarUtility.write("ログイン失敗!"); 79 82 return; 80 83 } 81 if (event.status == 403) {82 Alert.show("アク禁されてる><", "Login");83 StatusBarUtility.write("ログイン失敗!");84 return;85 }86 StatusBarUtility.write("ログイン成功!");87 84 } 88 85 } air/TLife/src/uwi/twitter/TwitterPostThread.as
r2139 r2200 4 4 import mx.controls.Alert; 5 5 import org.libspark.thread.Thread; 6 import uwi.util.CommonData; 6 7 import uwi.util.StatusBarUtility; 7 8 import uwi.util.URLPostThread; … … 37 38 { 38 39 if (eventname != null) { 40 Alert.show("なぞのエラー", "Login"); 39 41 StatusBarUtility.write(eventname + "失敗!"); 40 42 } … … 42 44 } 43 45 44 protected override function onResponse(e : HTTPStatusEvent) : void46 protected override function onResponse(event : HTTPStatusEvent) : void 45 47 { 46 if (e.status == 401) { 47 Alert.show("ログイン失敗", eventname); 48 if (event.status == 200) { 49 StatusBarUtility.write(eventname + "成功!"); 50 }else{ 51 Alert.show(CommonData.TWITTER_RESPONSE[event.status], eventname); 52 StatusBarUtility.write(eventname + "失敗!"); 48 53 return; 49 }50 if (eventname != null) {51 StatusBarUtility.write(eventname + "成功!");52 54 } 53 55 } air/TLife/src/uwi/twitter/TwitterReloadThread.as
r2183 r2200 102 102 103 103 for each(var hlt : HTMLLoaderThread in hlts) { 104 statuses = statuses.concat(StatusDOMScraper.scrape(hlt.html, posterid != CommonData.HOME)); 104 var ret : Object = StatusDOMScraper.scrape(hlt.html, posterid != CommonData.HOME); 105 if(ret.code == 0)statuses = statuses.concat(ret.statuses); 105 106 } 106 107 air/TLife/src/uwi/util/CommonData.as
r2199 r2200 24 24 public static const TABLE_STATUS : String = "status"; 25 25 public static const TABLE_POSTER : String = "poster"; 26 public static const TABLE_ FOLLOWING : String = "following";26 public static const TABLE_RELATION : String = "relation"; 27 27 28 28 public static const LIMLEN_POST : int = 140; … … 65 65 66 66 public static var urlcache : Object; 67 68 public static const TWITTER_RESPONSE : Object = { 69 "200" : "OK", 70 "304" : "新着情報がない", 71 "400" : "リクエスト却下", 72 "401" : "認証失敗", 73 "403" : "権限のないAPIの実行", 74 "404" : "存在しないAPI・ユーザー", 75 "500" : "Twitterの問題", 76 "502" : "Twitterサーバーが停止・メンテ中", 77 "503" : "Twitterサーバーの過負荷" 78 }; 67 79 } 68 80 air/TLife/src/uwi/util/StatusDOMScraper.as
r2199 r2200 10 10 public class StatusDOMScraper 11 11 { 12 // return code 13 // 0 : OK 14 // 1 : protected 15 // 2 : not found 16 12 17 // homeタイムライン用 13 18 // userid以外埋まったstatusを返す 14 public static function scrape(html : HTMLLoader, locally : Boolean = false) : Vector.<Status>19 public static function scrape(html : HTMLLoader, locally : Boolean = false) : Object // {statuses : Vector.<Status>, code : int} 15 20 { 16 21 var ret : Vector.<Status> = new Vector.<Status>(); … … 21 26 var postername : String; 22 27 23 if (locally) { 24 iconurl = doc.getElementById("profile-image").getAttribute("src"); 25 posterid = doc.title.substr(10); // "Twitter / ***" 26 // <div id="side"><div class="section"><ul class="about vcard entry-author"><li><span class="fn"> 27 postername = doc.getElementById("side").firstChild.childNodes[2].firstChild.lastChild.innerHTML; 28 try { 29 if (locally) { 30 iconurl = doc.getElementById("profile-image").getAttribute("src"); 31 posterid = doc.title.substr(10); // "Twitter / ***" 32 // <div id="side"><div class="section"><ul class="about vcard entry-author"><li><span class="fn"> 33 postername = doc.getElementById("side").firstChild.childNodes[2].firstChild.lastChild.innerHTML; 34 } 35 36 var timeline : Object = html.window.document.getElementById("timeline_body").getElementsByTagName("tr"); 37 for (var i : int = 0; i < timeline.length; i++) { 38 var element : Object = timeline[i]; 39 var atags : Object = element.getElementsByTagName("a"); 40 var spantags : Object = element.getElementsByTagName("span"); 41 42 var postid : String = element.id.substr(7); 43 44 if(!locally){ 45 iconurl = atags[0].firstChild.getAttribute("src"); 46 posterid = atags[1].innerHTML; 47 postername = atags[1].getAttribute("title"); 48 } 49 50 var content : String = spantags[0].innerHTML; // <span class="entry-content"> 51 52 // <span class="published"> 53 var datestr : String = spantags[2].getAttribute("title"); 54 var postedtime : Date = new Date(Date.UTC( 55 datestr.substr(0, 4), // year 56 Number(datestr.substr(5, 2)) - 1, // month 57 datestr.substr(8, 2), // day 58 datestr.substr(11, 2), // hour 59 datestr.substr(14, 2), // minute 60 datestr.substr(17, 2) // second 61 )); 62 63 var replyid : String = "0"; 64 var replyhref : String = spantags[1].lastChild.getAttribute("href"); 65 if(replyhref != null){ 66 replyid = replyhref.match(/[0-9]++$/)[0]; 67 } 68 69 var fav : Boolean = doc.getElementById("status_star_" + postid).className == "fav"; 70 71 // trace(new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav)); 72 ret.push(new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav)); 73 } 74 }catch (e : Error) { 75 trace(e.getStackTrace()); 76 return { statuses : null, code : 1 }; 28 77 } 29 78 30 var timeline : Object = html.window.document.getElementById("timeline_body").getElementsByTagName("tr"); 31 for (var i : int = 0; i < timeline.length; i++) { 32 var element : Object = timeline[i]; 79 return { statuses : ret, code : 0 }; 80 } 81 82 public static function scrapeBit(html : HTMLLoader) : Object // {status : Status, code : int} 83 { 84 try { 85 var userinfo : Object = html.window.document.getElementById("permalink").childNodes[3]; 86 var element : Object = html.window.document.getElementById("timeline_body"); 33 87 var atags : Object = element.getElementsByTagName("a"); 34 88 var spantags : Object = element.getElementsByTagName("span"); 35 89 36 var postid : String = element.id.substr(7);90 var inputtags : Object = html.window.document.getElementById("content").getElementsByTagName("input"); 37 91 38 if(!locally){ 39 iconurl = atags[0].firstChild.getAttribute("src"); 40 posterid = atags[1].innerHTML; 41 postername = atags[1].getAttribute("title"); 92 var iconurl : String = userinfo.childNodes[1].firstChild.firstChild.getAttribute("src"); 93 var posterid : String = userinfo.childNodes[3].firstChild.innerHTML; // <div class="screen-name"> 94 var postername : String; 95 if(userinfo.childNodes.length >= 6){ 96 postername = userinfo.childNodes[5].innerHTML; // <div class="full-name"> 97 }else { 98 postername = posterid; 42 99 } 43 100 101 var postid : String = element.firstChild.id.substr(7); 44 102 var content : String = spantags[0].innerHTML; // <span class="entry-content"> 45 46 103 // <span class="published"> 47 104 var datestr : String = spantags[2].getAttribute("title"); … … 57 114 var replyid : String = "0"; 58 115 var replyhref : String = spantags[1].lastChild.getAttribute("href"); 59 if (replyhref != null){116 if (replyhref != null) { 60 117 replyid = replyhref.match(/[0-9]++$/)[0]; 61 118 } 62 63 var fav : Boolean = doc.getElementById("status_star_" + postid).className == "fav"; 64 65 // trace(new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav)); 66 ret.push(new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav)); 119 var fav : Boolean = inputtags[inputtags.length - 1].className == "non-fav"; 120 }catch (e : Error) { 121 return { status : null, code : 1 }; 67 122 } 68 123 69 return ret;70 }71 72 public static function scrapeBit(html : HTMLLoader) : Status73 {74 var y : int;75 76 var userinfo : Object = html.window.document.getElementById("permalink").childNodes[3];77 var element : Object = html.window.document.getElementById("timeline_body");78 var atags : Object = element.getElementsByTagName("a");79 var spantags : Object = element.getElementsByTagName("span");80 81 var inputtags : Object = html.window.document.getElementById("content").getElementsByTagName("input");82 83 var iconurl : String = userinfo.childNodes[1].firstChild.firstChild.getAttribute("src");84 var posterid : String = userinfo.childNodes[3].firstChild.innerHTML; // <div class="screen-name">85 var postername : String;86 if(userinfo.childNodes.length >= 6){87 postername = userinfo.childNodes[5].innerHTML; // <div class="full-name">88 }else {89 postername = posterid;90 }91 92 var postid : String = element.firstChild.id.substr(7);93 var content : String = spantags[0].innerHTML; // <span class="entry-content">94 // <span class="published">95 var datestr : String = spantags[2].getAttribute("title");96 var postedtime : Date = new Date(Date.UTC(97 datestr.substr(0, 4), // year98 Number(datestr.substr(5, 2)) - 1, // month99 datestr.substr(8, 2), // day100 datestr.substr(11, 2), // hour101 datestr.substr(14, 2), // minute102 datestr.substr(17, 2) // second103 ));104 105 var replyid : String = "0";106 var replyhref : String = spantags[1].lastChild.getAttribute("href");107 if (replyhref != null) {108 replyid = replyhref.match(/[0-9]++$/)[0];109 }110 var fav : Boolean = inputtags[inputtags.length - 1].className == "non-fav";111 112 124 // trace(new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav)); 113 return new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav);125 return { status : new Status(postid, postername, posterid, content, replyid, postedtime, iconurl, fav), code : 0 }; 114 126 } 115 127

