View Full Version : Robot Moderator
amykhar
11-29-2001, 10:00 PM
Many boards have threads that must be posted on a schedule.
For example some freebies boards have a thread about what was in the mail on a given day. Site sharing boards might have a thread for each date. I have a forum for members to post reviews that they write at Epinions each day.
Originally, my moderators started the thread in our Just In forum every day. Then, our robot moderators - Justin and Justine were born.
I run this using a cron script shortly after midnight each day. It's been working for a few months now.
Here's what you need to do.
1. Create an account for your robot moderator - or moderators. My version allows you to have two of them. Which one posts on any given day is calculated randomly based on the date.
2. I gave mine fun sig lines and profile pix. Babe of the day type sites can have fun with this. My board offers one hottie for each gender. :D Give your robots a personality. For fun, sometimes I log in as one of them and play with the membership.
3. I have included a standalone script that you will need to modify to suit your needs. It should be pretty easy for you to do. It is attached here as robomod.txt give it any name you desire with a .php extension and upload it to your forum directory.
4. Test it to make sure it does what you think it will do by running the script.
5. Create a cron job to run the script. I use lynx to run mine. IMPORTANT cron needs the FULL PATH to lynx!
My cron looks something like this:
0 0 * * * /usr/bin/lynx -dump http://www.eaforums.com/robotmod.php
I am NOT a cron expert. I simply filled out what I needed in my cpanel. Check the cron man pages or your nearest neighborhood Unix guru for cron help :)
Demo: Justine (http://www.eaforums.com/forums/threadid21336session.html)
Justin (http://www.eaforums.com/forums/threadid21240session.html)
Amy
TheComputerGuy
11-30-2001, 10:24 PM
I will install it later tonight..but it looks so fun to play with nice work, thanks
Psychdrone
12-01-2001, 10:25 PM
sounds intresting, but i am a little confused to ezactly what it dose.......
amykhar
12-01-2001, 10:30 PM
It can be used to automatically post a thread using a cron script. It's great for lazy webmasters like me. ;)
Amy
Princeton
12-03-2001, 12:14 AM
Would it be possible to post an rss file using this code? For example, posting an rss file that would consist of 'Breaking News' around the world or 'Doc JavaScript's Tip of the Day Archive'. In other words, something that will change everyday (not the same text).
amykhar
12-03-2001, 12:41 AM
Sure. Instead of hardcoding the message and the subject, just make it read from a file.
Amy
Psychdrone
12-03-2001, 01:11 AM
and that would be done by............. :p
amykhar
12-03-2001, 01:23 AM
somebody other than me :D Sorry. I generally only work on hacks that I can use myself because my time is limited right now :(
Amy
Princeton
12-03-2001, 02:31 AM
I can't get this to work? My host tells me my cron script is correct.
certify
12-03-2001, 07:43 AM
Cool hack. I'll probably install this on my test board and see how it works.
GeorgeofCS
12-03-2001, 09:32 AM
You know I think this is definitely cool. A definite thing that would be good to add is to have this robotmod used for other purposes, like messaging onto reported threads, PMing users that were reported, etc.
amykhar
12-03-2001, 10:55 AM
Princeton,
Does it work when you run it from your browser?
Amy
Princeton
12-03-2001, 01:45 PM
Amy,
I got it to work. thank you
I don't think the rss (thing) is such a good idea. Anyway, it works perfectly. I'm just thinking of a good way to use it.
hypedave
01-09-2002, 10:58 AM
is there a way to get this to work on Windows 2000 server., I heard that windows doesnt have a cron job,
amykhar
01-09-2002, 12:24 PM
Before I got cron to work, I used a windows scheduler program to simply call the url from my pc each day. The downside was that I had to be connected to the Internet for that to work.
Amy
hypedave
01-09-2002, 01:05 PM
hey can you give me mor detail as in how you got it work
My configuration is a Windows 2000 Server with IIS
and it is connected to the net cause its running the forum,
amykhar
01-09-2002, 02:49 PM
hypedave,
I didn't mean run it on the same server as your forum. A window would have to be manually closed each day the way I did it. Maybe somebody else would know of a way for you to do it on a Windows server. Have you looked at a windows port of cron?
Amy
hypedave
01-09-2002, 03:05 PM
Oh okay I wouldnt mind running it on a seperate pc I have to. Just tell me how you did it, and what app you used, im very interested in adding this to my site. I havent looked at a windows port of cron. did you mean do I know what port cron uses, I didnt understand that last question
thanks.
hypedave
04-12-2002, 03:41 AM
this robot mod is so cool, I just got it to work
nice job
how do I specify my own subject instead of it using a date
amykhar
04-12-2002, 12:48 PM
In the code, simply change the $subject variable to the string of your choice. If you want the subject to be dynamic, that's a bit trickier. You would need to get the dynamic information into the script.
For example, if you wanted to start a new post each day that welcomed all new users by name in the subject line, you would have to do a query to get the names of everyone who joined in the past 24 hours, and put that information into your subject string.
Comment out my line that sets the subject as the date, and right after that, put (for example) $subject = "This is an automatic post!";
Hope that splains what you needed to know.
Amy
hypedave
04-12-2002, 02:04 PM
hey cool thasnk, I figured it out like, im gonna write a visual basic app for this, if you are interested in let me know
hypedave
04-12-2002, 02:30 PM
okay two more things
How do I make it so that when it post it doesnt post icons ?
How do i make it so that when it post it does recieve a post count
also how can I get it to reply back to someone elses thread ?
Sheldon Rampton
08-04-2002, 05:57 PM
I'm trying to use this code as the basis for a PHP program that will automatically post items from my weblog as new threads in a vBulletin forum, but I'm having a problem. When I try to test this by calling my PHP program from my web browser, I get a message that says "Please Log in: You are either not a valid administrator or have not logged in." After I go ahead and log in, the PHP program runs as expected, but I want this to run automatically, without requiring manual intervention.
Here's the URL that I've been using for my test program:
http://www.prwatch.org/forum/admin/post2forum.php
If I get this message when I try to execute the program from my web browser, won't the login requirement also block it from executing properly as a cron job?
amykhar
02-04-2003, 12:45 PM
Sheldon, I didn't put mine in admin. However, I believe you can simply pass the username and password in as variables. Not sure on that one though, but couldn't hurt to try.
Amy
amykhar
02-04-2003, 12:48 PM
Originally posted by hypedave
okay two more things
How do I make it so that when it post it doesnt post icons ?
I had some code from another hack that did this, but at the time it crashed and I didn't want to waste my time debugging it.
[/quote]
How do i make it so that when it post it does recieve a post count
also how can I get it to reply back to someone elses thread ?
dstruct2k
04-10-2003, 09:13 PM
[QUOTE]01-09-02 at 09:59 AM hypedave said this in Post #16 (https://vborg.vbsupport.ru/showthread.php?postid=211981#post211981)
hey can you give me mor detail as in how you got it work
My configuration is a Windows 2000 Server with IIS
and it is connected to the net cause its running the forum,
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.