diff --git a/commands/search.js b/commands/search.js index e79dd8e..e7b04c7 100644 --- a/commands/search.js +++ b/commands/search.js @@ -15,17 +15,29 @@ module.exports = { message.reply('Searching for: ' + search); let i = 0; + let iSave = 0 + let count = 0; var feedArray = libFlayer.getFeeds(); feedArray.forEach(linkFlay => { if (linkFlay.title.toLowerCase().indexOf(search.toLowerCase()) > -1) { + iSave = i; found = true; console.log(linkFlay.title); message.reply(`Use !get ${i} to view: ${linkFlay.title}`); - + count++; } i++; + }); + if (count == 1) { + //message.channel.send('Displaying 1 result'); + //message.channel.send('!get '+iSave); + } + if (count > 0) { + message.channel.send(`Displaying results for: ${search}`); + } + if (!found) { message.reply(`No results found for: ${search}`); } diff --git a/feeds.json b/feeds.json index 49ffa18..eea50f5 100644 --- a/feeds.json +++ b/feeds.json @@ -10,6 +10,25 @@ { "title": "Arstechnica", "link": "http://feeds.arstechnica.com/arstechnica/index" - } - + }, + { + "title": "TechCrunchGadgets", + "link": "https://techcrunch.com/gadgets/feed/" + }, + { + "title": "BusinessInsider", + "link": "https://markets.businessinsider.com/rss/news" + }, + { + "title": "TheGuardian", + "link": "https://www.theguardian.com/world/rss" + }, + { + "title": "Yahoo", + "link": "https://news.google.com/news/rss" + }, + { + "title": "CBSWorldNews", + "link": "https://www.cbsnews.com/latest/rss/world" + } ] \ No newline at end of file