Collaborama About Help Contact Anonymous [login] Source: site.view [edit] Function name: salientFeeds Arguments: list Description: Accepts a list of RSS feed urls and determines which items are of interest by scanning for simple keywords. Returns an RSS string made up of just the interesting items. Page type: webl Render function: Module: sandbox Page source: // These are the keywords to look for. var keywords = ["rumor", "acquisition", "merger", "fraud", "prosecution", "arrested", "unexpected", "shattering", "exceptional", "dramatic", "surprise", "combination", "spinoff", "spin-off", "takeover", "buyout", "MBO", "LBO", "in play", "bear hug", "tender", "bankrupcy", "chapter 11"]; // add more keywords in this list var itemRss = ""; every url in list do var P = GetURL(url) ? nil; if (P != nil) then var items = Elem(P, "item"); every item in items do var txt = Str_ToLowerCase(Pretty(item)); var found = false; every keyword in keywords do found = found or (Str_IndexOf(keyword, txt) >= 0) end; if found then itemRss = itemRss + Pretty(item) + "\n"; end end end end; var rssHeader = `<rss version="2.0"> <channel> <title>Salient news for NASDAQ100 and NYSE selection</title> <description>Articles which contain: ` + ToString(keywords) + `</description> `; var rssFooter = ` </channel> </rss> `; // Return a header, the items, and the footer rssHeader + itemRss + rssFooter;