Skip to content

Instantly share code, notes, and snippets.

@dai-shi
Last active December 15, 2015 14:39
Show Gist options
  • Save dai-shi/5276006 to your computer and use it in GitHub Desktop.
Save dai-shi/5276006 to your computer and use it in GitHub Desktop.
タイトルのキーワードで絞込みするフィルター #rsspipes
function rssPipesFilterFunction(articles) {
var keywords = ["ABC", "DEF", "GHI"];
var i, len = keywords.length;
var newArticles = [];
articles.forEach(function(article) {
if (article.title) {
for (i = 0; i < len; i++) {
if (article.title.indexOf(keywords[i]) >= 0) {
newArticles.push(article);
break;
}
}
}
});
return newArticles;
}
/*
* Copyright (c) 2013 Daishi Kato
* Licensed under the MIT License
* http://www.opensource.org/licenses/mit-license.php
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment