Skip to content

Instantly share code, notes, and snippets.

@dai-shi
Last active December 15, 2015 19:18
Show Gist options
  • Save dai-shi/5309864 to your computer and use it in GitHub Desktop.
Save dai-shi/5309864 to your computer and use it in GitHub Desktop.
タイトルのキーワードマッチでタイトルを目立たせる #rsspipes
function rssPipesFilterFunction(articles) {
var keywords = ["keyword01", "keyword02", "keyword03"];
var i, len = keywords.length;
articles.forEach(function(article) {
if (article.title) {
for (i = 0; i < len; i++) {
if (article.title.indexOf(keywords[i]) >= 0) {
article.title = "*** " + article.title;
break;
}
}
}
});
return articles;
}
/*
* 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