Link | yahoo_wordoftheday |
Author | Jason Huck |
Category | Utility |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 05 Oct 2006 |
Updated | 05 Oct 2006 |
More by this author... |
Returns the Word of the Day from Yahoo! Education as a map containing the word, the definition, the publish date, and a permalink. Stores the results in a global which expires every 24 hours. Requires [xml_tree].
var('myWord') = yahoo_wordoftheday; 'Word of the Day: ' + $myWord->find('word') + ' - ' + $myWord->find('definition');
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.
define_tag( 'wordoftheday', -namespace='yahoo_', -priority='replace', -description='Returns the Word of the Day from Yahoo!' ); if( global_defined('yahoo_wotd') && $yahoo_wotd->find('date')->difference(date, -hour) < 24 ); return($yahoo_wotd); else; local('data') = xml_tree(string(include_url('http://xml.education.yahoo.com/rss/wotd/'))); local('out') = map( 'word' = #data->channel->item->title->contents->split(' - ')->first, 'definition' = #data->channel->item->description->contents, 'link' = 'http://education.yahoo.com/' + #data->channel->item->guid->contents, 'date' = date_gmttolocal(date(#data->channel->item->pubDate->contents, -format='%a, %d %b %Y %H:%M:%S GMT')) ); global('yahoo_wotd') = #out; return(#out); /if; /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft