User Control Panel
Advertisements

HELP US, HELP YOU!

World News

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Apr 12, 2004 7:56 pm    Post subject: Reply with quote

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. Razz

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.

Quote:
MSN
Cody says:
   .: World News :.

   Insurgents in Iraq Release 12 Hostages
   http://www.maximumedge.com/cgi/news/articl...40412/D81TCQHG0

AIM
CodyCKS: .: World News :.

o
Insurgents in Iraq Release 12 Hostages

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/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group