User Control Panel
Advertisements

HELP US, HELP YOU!

pls help about rss on evobot

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
erhansi
Newbie
Newbie


Joined: 03 Oct 2006
Posts: 8


PostPosted: Sun Oct 08, 2006 8:43 pm    Post subject: pls help about rss on evobot Reply with quote

Hello

I really cant do that rss issue.. please help me .. how can I put rss in my bot?
please give me a good example and explaining.. eveybody can learn that from this forum and I need that very much. I digged about rss but I could not understand .. please dont tell me about cpan.org I could not understand there either..
please info step by step
thank you so much
Back to top
JTW
God Like
God Like


Joined: 07 Mar 2004
Posts: 579
Location: Maidstone
Reputation: 67.1
votes: 4

PostPosted: Mon Oct 09, 2006 1:10 pm    Post subject: Reply with quote

Hey,
There is a really cool module out there called XML::Simple and it really makes the job simple.

Here is my !neowin command Have a look and it should help you.

Code wrote:
sub neowin
{
my ($bot,$self, $user, $name, $msg, $color) = @_;

use XML::Simple;
$self->sendMessage("Please wait whilst I gather the information.");

$reply = "Latest Posts from Neowin [http://www.neowin.net/]\n\n";
$data = XMLin(get('http://www.neowin.net/backend.php?page=main'));
for ($i=0;$i<4;$i++){
$item = @{$data->{channel}->{item}}[$i];
$reply .= $item->{title}."\n".$item->{link}."\n\n";
}
return "$reply";

};


The one line you may not get is
Quote:
for ($i=0;$i<4;$i++){
The 4 is how many times you want to show the information i.e. if there were three diffrent <items> but you only want 2 you would set the number to 2.

JT

dmedit: changed [code to [quote to allow for [color.

_________________
"Help us, Help you" - BotDepot
Back to top
erhansi
Newbie
Newbie


Joined: 03 Oct 2006
Posts: 8


PostPosted: Mon Oct 09, 2006 5:42 pm    Post subject: Reply with quote

matee it worked perfect! thank you soo much !
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Tue Oct 10, 2006 2:44 pm    Post subject: Reply with quote

Apart from it working, do you understand the code? Understanding it will allow you to do simular things in the future without having to rely on code hand-outs.

Glad it helped you Smile (even though I didn't give it to you Razz)

_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help 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