This is a command I made to get world news. I coded this myself, but I used the same URL that the WiredBots counterpart uses because I couldn't find any good plain text RSS feeds and didn't want to bother with XML parsers.
So anyhow, here it is.
Code:
sub news {<br /> my ($self,$client,$msg,$listener) = @_;<br /><br /> # World News Command.<br /> # Coded by: Cerone Kirsle <kirsle@kirsle.net><br /> # Credits:<br /> # WiredBots - I used the URL they use because I couldn't find<br /> # any good RSS feeds. :P<br /><br /> # Start the reply.<br /> my $reply = ".: World News :.\n\n";<br /><br /> # Get the news content.<br /> my $src = get "http://www.maximumedge.com/cgi/news/top.txt";<br /> my @lines = split(/\n/, $src);<br /><br /> # Go through the source.<br /> foreach my $line (@lines) {<br /> my @parts = split(/\|/, $line);<br /><br /> # Format this for AIM or MSN.<br /> if ($listener eq "MSN") {<br /> $reply .= "$parts[1]\n"<br /> . "http://www.maximumedge.com/cgi/news/article.cgi/$parts[0]\n\n";<br /> }<br /> else {<br /> $reply .= "o <a href=\"http://www.maximumedge.com/cgi/news/article.cgi/$parts[0]\">"<br /> . "$parts[1]</a>\n";<br /> }<br /> }<br /><br /> # Return the reply.<br /> return $reply;<br />}<br />1;
It works just as well on HTML restricted services such as MSN.
The red text in the example is *supposed* to be underlined, but the underline code gets filtered to "*lazy*". Eric should fix that. B) _________________ Current Site (2008) http://www.cuvou.com/