Posted: Tue Jan 16, 2007 12:12 am Post subject: Rss With Maya Bot
I can get maya to get information from rss for me but i dont know how to configure so that i only get a certain amount of entries not all of them, just say the first five this is my code can someone help me out?
Quote:
use XML::Simple;
use LWP::Simple;
print wired();
sub wired{
my $text;
my $rss = XMLin(get("http://www.wired.com/news/feeds/rss2/0,2610,,00.xml"));
foreach $item (@{$rss->{channel}->{item}}) {
$text .= "$item->{title}\n$item->{link}\n";
}
&send($self,"$text");
}
Posted: Tue Jan 16, 2007 4:45 am Post subject: RSS
Ok...i figured it out myself...i was just being lazy if anyones stuck and you want an rss reader for maya here it is:
Quote:
use XML::Simple;
&send($self,"(O) Please wait while we get the content [from http://www.geekzone.co.nz]");
print rss();
sub rss{
$reply = "Geekzone RSS [http://www.geekzone.co.nz/]\n\n";
$data = XMLin(get('http://www.geekzone.co.nz/geekzone_rss.asp'));
for ($i=0;$i<5;$i++){
$item = @{$data->{channel}->{item}}[$i];
$reply .= $item->{title}."\n".$item->{link}."\n\n";
}
&send($self,"$reply");
};