From fbde07c70ad1929aadc6eca75be2b1aca81cdec5 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 4 Aug 2010 14:44:03 +0000 Subject: Twitter 検索が使えていなかったのを修正した git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38171 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 15 +++++++++++++-- 1 file 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) { // {{{ -- cgit v1.2.3