From c18c92acd773b079f074ace54d7d0c37fbdfbda6 Mon Sep 17 00:00:00 2001
From: anekos
Date: Sun, 15 Aug 2010 05:53:03 +0000
Subject: 検索結果が 0 の時にそれを知らせる
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38274 d0d07461-0603-4401-acd4-de1884942a52
---
twittperator.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'twittperator.js')
diff --git a/twittperator.js b/twittperator.js
index 50ead27..805199a 100755
--- a/twittperator.js
+++ b/twittperator.js
@@ -28,7 +28,7 @@ let PLUGIN_INFO =
twittperator
Twitter Client using ChirpStream
OAuth対応Twitterクライアント
- 1.1.1
+ 1.1.2
2.3
2.4
teramako
@@ -1589,7 +1589,12 @@ let PLUGIN_INFO =
}
tw.get("http://search.twitter.com/search.json", { q: word }, function(text) {
- Twittperator.showTL(JSON.parse(text).results.map(Util.fixStatusObject).map(konbuArt));
+ let results = JSON.parse(text).results;
+ if (results.length > 0) {
+ Twittperator.showTL(results.map(Util.fixStatusObject).map(konbuArt));
+ } else {
+ Twittperator.echo("No results found.")
+ }
});
}, // }}}
sourceScriptFile: function (file) { // {{{
--
cgit v1.2.3