Link | yahoo_customnews |
Author | Jim Van Heule |
Category | Utility |
Version | 8.x |
License | Public Domain |
Posted | 16 Jun 2008 |
Updated | 16 Jun 2008 |
More by this author... |
Given a valid feed name for Yahoo! Custom News, returns the current feed data as an array of maps. Use keywords using spaces between words.
This tag does not handle standard Yahoo news feeds. Yahho_News should be used for those.
Credit: Based on Jason Huck's yahoo_news tag and modified to handle custom news.
[//lasso ''; 'Customize your news search with keywords'; var('mynews') = Yahoo_CustomNews(Action_Param:'newsitem'); // $mynews; If:$mynews -> (Size) > 0; iterate($mynews, local('i')); '
' + #i->find('description') + '
\n'; /iterate; /If; ]Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
[//lasso define_tag( 'customnews', -namespace='yahoo_', -req='feed', -priority='replace', -description='Retrieves the specified news feed from Yahoo! Custom News.' ); local('out' = array); protect; #feed -> (Replace: ' ', '+'); local('data') = xml_tree(include_url('http://news.search.yahoo.com/news/rss?p=' + #feed + '&ei=UTF-8&fl=0&x=wrt')); handle_error; return; /handle_error; /protect; local('nodes') = array( 'title', 'link', 'guid', 'pubDate', 'description', 'content', 'text', 'credit' ); iterate(#data->channel->item, local('i')); local('temp' = map); iterate(#nodes, local('n')); protect; local('raw') = decode_html(#i->getnode(#n)->contents); #raw->trim; #n == 'pubDate' ? #raw = date(#raw, -format='%a, %d %b %Y %H:%M:%S GMT'); // Thu, 20 Jul 2006 16:22:22 GMT #temp->insert(#n = #raw); /protect; /iterate; #out->insert(#temp); /iterate; return(#out); /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft