User Control Panel
Advertisements

HELP US, HELP YOU!

Best way of doing this

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


Joined: 02 Oct 2006
Posts: 7


PostPosted: Thu Nov 02, 2006 5:25 pm    Post subject: Best way of doing this Reply with quote

Hi there! Smile

I'm in the process of making a bot that can show your MSN status through an image, like Ben's Bot, WebDP, all of them.

It's mainly just to expand my knowledge with Perl, but I'm wondering if theres a better way of doing it.

What I'm currently doing is when someone adds the bot, it creates a PHP file (and uploads it) that looks at an ini file on the web server I have, and gets the user's status and displays it. Meanwhile I have it writing everyone's status to an ini file, and uploading that every 10 seconds (it only uploads if someone has changed their status since last time) through FTP.

No matter if the ini file gets uploaded or not, the script will "ping" my site to tell the site that the bot is still running.

If you understand that, please tell me, is there a better way at doing this?

Thanks alot.
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Thu Nov 02, 2006 7:42 pm    Post subject: Reply with quote

You can try not using FTP and upload the file, but just use LWP::Simple and get a file on the server to update the user's status, ie

Code:
use LWP::Simple;
get "http://domain/status.php?user=$user&status=away";


and then the php script on the server would update with their new status info.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Schmexi
Newbie
Newbie


Joined: 02 Oct 2006
Posts: 7


PostPosted: Fri Nov 03, 2006 3:31 am    Post subject: Reply with quote

I thought about doing it that way, but the problem I encountered was that the user's email is encrypted, and that can get quite long at times. As far as I know PHP only allows 100 characters when using get, so I didn't do it. Also, if the contact list got quite big, I'm wondering if it would take longer to do it that way or not.

Thanks so much for your reply! Any other suggestions? Smile
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Fri Nov 03, 2006 2:57 pm    Post subject: Reply with quote

Query string limits are in your server configuration, not PHP. An alternative is to use POST instead of GET...

Code:
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->post ('http://domain/status.php', {
   username => $user,
   status => 'online',
});


There's no set size limit on POST as far as I know unless your script explicitly specifies one.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Schmexi
Newbie
Newbie


Joined: 02 Oct 2006
Posts: 7


PostPosted: Fri Nov 03, 2006 3:14 pm    Post subject: Reply with quote

Thanks so much for the code, I'll try it out tomorrow when I wake up. Do you think doing that for each user will be faster than uploading a single text file?

I'll post any results I come up with tomorrow. Thanks again!
Back to top
Schmexi
Newbie
Newbie


Joined: 02 Oct 2006
Posts: 7


PostPosted: Tue Nov 07, 2006 10:21 am    Post subject: Reply with quote

Sorry for the late reply, I've been mucking around with a Perl Web Crawler.

I managed to get my bot's contact list up to 16 online people, and tried the Post method. It was around 6 seconds slower than uploading the single text file, so I think I'll stick with the text file.

Thanks so much for your help. Smile
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