Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-15-2002, 11:29 PM   #1
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,120
Forum Bot

Hey bros, I really would like to make a forum bot like this one http://www.vereor.com/forum/viewforum.php?f=11 where I can teach it to answer repetitive questions that get asked all the time as well as have a conversation with people.

I figured I would start with something simple... like a bot that posts the daily world news, or sports scores... something like that...

Is this possible with Perl or would I have to use this AIML one http://alice.sunlitsurf.com to interact with my site and do what I need?

Also, do you have any idea how to get started?

Well, since my first bot won't be interactive (until I get a brain for it) it doesn't have to monitor the forums for new messages... just post to them at a timed interval.

So I guess it's a simple matter of calling an HTML page (or PHP in the case with my forums) and getting the bot to fill out forms. Sounds pretty simple to me, but I don't know where to start...
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 12:26 AM   #2
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,120
I'm just learning Perl. To be more clear and concise --

Is there is a special module I have to install to be able to talk to my website and fill forms?

What command do I need to fetch a page?

?Would it be like:
my $form = get("http://www.mydomain.com/forums/index.php?act=Post&CODE=00&f=1");

What command do I need to fill out and send a form?

Do I even need to get the page or can I just have it fill out the form and send it?
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 12:29 AM   #3
WiredGuy
Pounding Googlebot
 
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,482
LWP module. Beautiful module that let's you interact with the web (forms included).

Once installed, perldoc LWP for details.

If this is your first time using LWP, do something even simpler like just fetching a webpage (2 liner), and then work up from there.

WG
__________________
I play with Google.
WiredGuy is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 12:29 AM   #4
boldy
Macdaddy coder
 
Industry Role:
Join Date: Feb 2002
Location: MacDaddy pimp coder
Posts: 2,806
use HTML::FillInForm




see www.cpan.org for details, it rox for form filling ... Hmmm wonder where i use that for
__________________
MacDaddy Coder.
boldy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 12:30 AM   #5
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,120
Thank you sooo much buddies! Programming is sooo FUN!

GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 12:31 AM   #6
WiredGuy
Pounding Googlebot
 
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,482
Quote:
Originally posted by boldy
use HTML::FillInForm




see www.cpan.org for details, it rox for form filling ... Hmmm wonder where i use that for
If you just need to fill out forms automatically, then boldy is right, use that module. LWP is more general for anything relating to web communications. More powerful but naturally more complex to code...

WG
__________________
I play with Google.
WiredGuy is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 12:31 AM   #7
boldy
Macdaddy coder
 
Industry Role:
Join Date: Feb 2002
Location: MacDaddy pimp coder
Posts: 2,806
Quote:
Originally posted by GFED
Thank you sooo much buddies! Programming is sooo FUN!

__________________
MacDaddy Coder.
boldy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-16-2002, 01:10 AM   #8
WiredGuy
Pounding Googlebot
 
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,482
Quote:
Originally posted by GFED
Thank you sooo much buddies! Programming is sooo FUN!

We'll see :-)
Perl is a love/hate relationship. When it doesn't work, your baffled, when it does, its sweet.

Enjoy.
WG
__________________
I play with Google.
WiredGuy is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2002, 12:44 AM   #9
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,120
this is what I have so far...

Code:
#!/usr/local/bin/perl

use LWP::Simple;
use HTML::FillInForm;
use CGI;

print "start\n\n";

worldnews();
print $reply;

forumPost($reply);

print "end\n\n";

sub forumPost($reply){
	##form fields: TopicTitle,TopicDesc,Post
	print "start forumPost\n\n";
	my $html = get("http://www.mastersofporn.com/forums/index.php?s=&act=Post&CODE=00&f=13");
	#print $html;
	
	my $a = new CGI;
	my $b = new CGI;
	my $q = new CGI;
	
	$a->param("TopicTitle","testing");
	$b->param("TopicDesc","testing");
	$q->param("Post","$reply");
	
	my $fif = new HTML::FillInForm;
	my $output = $fif->fill(scalarref => \$html,
		#fobject => $q);
		fobject => [$a, $b, $q]);
		
	print $output;
	print "end forumPost\n\n";
}

sub worldnews {
	print "start worldnews\n\n";
	my $content = get("http://www.maximumedge.com/cgi/news/top.txt");
	my @lines = split("\n",$content);
	foreach $line(@lines) {
		my @parts = split(/\|/,$line);
		$reply .= "A HREF=\"http://www.maximumedge.com/cgi/news/article.cgi/";
		$reply .= $parts[0]."\">".$parts[1]."\/A>\n\n";
	}
	return $reply;
	print "end worldnews\n\n";
}
I couldn't disable HTML so I took off the "<"'s on the A tags...

I think it's filling out the form... I can't really tell from my DOS prompt on my local machine and it gives me 500 on the server...

Help Please?
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2002, 12:53 AM   #10
SpaceAce
Confirmed User
 
Join Date: Jul 2002
Location: Magrathea
Posts: 6,493
If you're going to be doing anything complex over the web, you'll want to learn LWP and IO::Socket. Hang out at http://www.perlmonks.org - they're very helpful over there. And get yourself a copy of "Perl Core Language Little Black Book".

Good luck,
SpaceAce
SpaceAce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2002, 12:55 AM   #11
SpaceAce
Confirmed User
 
Join Date: Jul 2002
Location: Magrathea
Posts: 6,493
Oh, yeah, and check this out for a neat example of databasing/knowledge collection:
http://www.smalltime.com/dictator.html

SpaceAce
SpaceAce is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-17-2002, 03:43 AM   #12
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,120
Thanks for the links SpaceAce!
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.