![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
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...
__________________
https://www.flow.page/savethechildren |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
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?
__________________
https://www.flow.page/savethechildren |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: May 2002
Posts: 8,120
|
Thank you sooo much buddies! Programming is sooo FUN!
![]() ![]()
__________________
https://www.flow.page/savethechildren |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Pounding Googlebot
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,482
|
Quote:
WG
__________________
I play with Google. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Macdaddy coder
Industry Role:
Join Date: Feb 2002
Location: MacDaddy pimp coder
Posts: 2,806
|
Quote:
![]()
__________________
MacDaddy Coder. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Pounding Googlebot
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,482
|
Quote:
Perl is a love/hate relationship. When it doesn't work, your baffled, when it does, its sweet. Enjoy. WG
__________________
I play with Google. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
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 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?
__________________
https://www.flow.page/savethechildren |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: May 2002
Posts: 8,120
|
Thanks for the links SpaceAce!
![]()
__________________
https://www.flow.page/savethechildren |
![]() |
![]() ![]() ![]() ![]() ![]() |