diff options
Diffstat (limited to 'twittperator.js')
-rwxr-xr-x | twittperator.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/twittperator.js b/twittperator.js index 6283544..28193e4 100755 --- a/twittperator.js +++ b/twittperator.js @@ -1232,9 +1232,20 @@ return str; } // }}} function showTwitterSearchResult(word) { // {{{ + // フォーマットが違うの変換 + function konbuArt(obj) { + return { + __proto__: obj, + user: { + __proto__: obj, + screen_name: obj.from_user, + id: obj.from_id + } + }; + } + tw.get("http://search.twitter.com/search.json", { q: word }, function(text) { - let results = JSON.parse(text); - showTL(results); + showTL(JSON.parse(text).results.map(konbuArt)); }); } // }}} function getFollowersStatus(target, force, onload) { // {{{ |