Changeset 38293
- Timestamp:
- 08/17/10 20:59:04 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/twittperator.js
r38275 r38293 29 29 <description>Twitter Client using ChirpStream</description> 30 30 <description lang="ja">OAuth対応Twitterクライアント</description> 31 <version>1.1. 3</version>31 <version>1.1.4</version> 32 32 <minVersion>2.3</minVersion> 33 33 <maxVersion>2.4</maxVersion> … … 1018 1018 }, 1019 1019 }; 1020 Util .xmlhttpRequest(options);1020 Utils.xmlhttpRequest(options); 1021 1021 1022 1022 }, … … 1065 1065 }; 1066 1066 1067 Util .xmlhttpRequest(options); // 送信1067 Utils.xmlhttpRequest(options); // 送信 1068 1068 }, 1069 1069 // api+?+query にアクセスした結果をcallbackに渡す … … 1095 1095 }, 1096 1096 }; 1097 Util .xmlhttpRequest(options); // 送信1097 Utils.xmlhttpRequest(options); // 送信 1098 1098 }, 1099 1099 post: function(api, content, callback) { … … 1128 1128 } 1129 1129 }; 1130 Util .xmlhttpRequest(options); // 送信1130 Utils.xmlhttpRequest(options); // 送信 1131 1131 }, 1132 1132 getAuthorizationHeader: function(api) { … … 1314 1314 try { 1315 1315 if (/^\s*\{/(line)) 1316 onMsg(Util .fixStatusObject(JSON.parse(line)), line);1316 onMsg(Utils.fixStatusObject(JSON.parse(line)), line); 1317 1317 } catch (e) { liberator.log(e); } 1318 1318 } … … 1364 1364 favorite: function (id) { // {{{ 1365 1365 tw.post("http://api.twitter.com/1/favorites/create/" + id + ".json", null, function(text) { 1366 let res = Util .fixStatusObject(JSON.parse(text));1366 let res = Utils.fixStatusObject(JSON.parse(text)); 1367 1367 Twittperator.echo("fav: " + res.user.name + " " + res.text) 1368 1368 }); … … 1395 1395 setRefresher(); 1396 1396 // TODO 履歴をちゃんと "追記" するようにするようにするべき 1397 let result = JSON.parse(text).map(Util .fixStatusObject);1397 let result = JSON.parse(text).map(Utils.fixStatusObject); 1398 1398 if (!target) 1399 1399 history = result; … … 1417 1417 sendData.source = "Twittperator"; 1418 1418 tw.post("http://api.twitter.com/1/statuses/update.json", sendData, function(text) { 1419 let t = Util .fixStatusObject(JSON.parse(text || "{}")).text;1419 let t = Utils.fixStatusObject(JSON.parse(text || "{}")).text; 1420 1420 Twittperator.echo("Your post " + '"' + t + '" (' + t.length + " characters) was sent."); 1421 1421 }); … … 1424 1424 let url = "http://api.twitter.com/1/statuses/retweet/" + id + ".json"; 1425 1425 tw.post(url, null, function(text) { 1426 let res = Util .fixStatusObject(JSON.parse(text));1426 let res = Utils.fixStatusObject(JSON.parse(text)); 1427 1427 Twittperator.echo("ReTweet: " + res.retweeted_status.text); 1428 1428 }); … … 1430 1430 unfavorite: function (id) { // {{{ 1431 1431 tw.post("http://api.twitter.com/1/favorites/destroy/" + id + ".json", null, function(text) { 1432 let res = Util .fixStatusObject(JSON.parse(text));1432 let res = Utils.fixStatusObject(JSON.parse(text)); 1433 1433 Twittperator.echo("unfav: " + res.user.name + " " + res.text, true); 1434 1434 }); 1435 1435 }, // }}} 1436 1436 }; // }}} 1437 let Util = { // {{{1437 let Utils = { // {{{ 1438 1438 anchorLink: function (str) { // {{{ 1439 1439 let m = str.match(/https?:\/\/\S+/); … … 1442 1442 let url = m[0]; 1443 1443 let right = str.substring(m.index + m[0].length); 1444 return <>{Util .anchorLink(left)}<a highlight="URL" href={url}> {url} </a>{Util.anchorLink(right)}</>;1444 return <>{Utils.anchorLink(left)}<a highlight="URL" href={url}> {url} </a>{Utils.anchorLink(right)}</>; 1445 1445 } 1446 1446 return str; … … 1452 1452 let result = {}; 1453 1453 for (let [n, v] in Iterator(st)) { 1454 result[n] = v && typeof v === 'object' ? Util .fixStatusObject(v) :1454 result[n] = v && typeof v === 'object' ? Utils.fixStatusObject(v) : 1455 1455 n === 'text' ? unescapeAmps(v) : 1456 1456 v; … … 1550 1550 </a> 1551 1551 </td><td class="twitter entry-content rt"> 1552 {Util .anchorLink(rt.text)}1552 {Utils.anchorLink(rt.text)} 1553 1553 </td> 1554 1554 </tr> : … … 1560 1560 </a> 1561 1561 </td><td class="twitter entry-content"> 1562 {Util .anchorLink(status.text)}1562 {Utils.anchorLink(status.text)} 1563 1563 </td> 1564 1564 </tr> … … 1573 1573 showTwitterMentions: function (arg) { // {{{ 1574 1574 tw.get("http://api.twitter.com/1/statuses/mentions.json", null, function(text) { 1575 Twittperator.showTL(JSON.parse(text).map(Util .fixStatusObject));1575 Twittperator.showTL(JSON.parse(text).map(Utils.fixStatusObject)); 1576 1576 }); 1577 1577 }, // }}} … … 1592 1592 let results = JSON.parse(text).results; 1593 1593 if (results.length > 0) { 1594 Twittperator.showTL(results.map(Util .fixStatusObject).map(konbuArt));1594 Twittperator.showTL(results.map(Utils.fixStatusObject).map(konbuArt)); 1595 1595 } else { 1596 1596 Twittperator.echo("No results found.") … … 1894 1894 __context__.ChirpUserStream = ChirpUserStream; 1895 1895 __context__.Twittperator = Twittperator; 1896 __context__.Utils = Utils; 1896 1897 1897 1898 Twittperator.loadPlugins();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)