• Wanted to make a forum bot... Where to start?
    16 replies, posted
Particularly I wanted the bot to be able to log into a user on a given forum like facepunch and retrieve posts from a specific page of a specific thread. Compwhizii's 8ball bot is what perked my interest [url=http://gist.github.com/365204]Source code here[/url], sadly all the source code is not present. Does anyone know of any frameworks/APIs out there, I did some googling which failed miserably as it usually does... It'd be nice if it where in something like C#, C++, PHP, or some other scripting language, anything but java really.
PHP would only work if you could upload your script to the server I think (or hacked the mysql data or files so you could do it remotely). A javascript greasemonkey script would be your best bet I think. Or you could auto navigate with a custom web browser, manipulate your session and stuff.
In C# you can use System.Net.WebClient.
Guys, I realize you want to help or maybe you're just bored, but I need a response that'll actually point me in some direction not "use javascript" or "try C# it has this <insert random function name>". Honestly... [QUOTE=neos300;21358100]PHP would only work if you could upload your script to the server I think (or hacked the mysql data or files so you could do it remotely).[/QUOTE] What? In my OP I have obvious evidence directly against that statement... It can be done in any language that can retrieve content from another server, analyze it, and send input back... (and store cookies)
It's all here [url]http://github.com/compwhizii/PostWorks[/url]
[QUOTE=compwhizii;21359400]It's all here [url]http://github.com/compwhizii/PostWorks[/url][/QUOTE] Ty bro, no hard feelings about the 8ball thing, you know I was just messin' :P Did you write all this?
Yep.
[QUOTE=XCIV;21359334]Guys, I realize you want to help or maybe you're just bored, but I need a response that'll actually point me in some direction not "use javascript" or "try C# it has this <insert random function name>". Honestly...[/QUOTE] If you'd had looked it up, you'd have seen it's a class that has all the methods you need, POST requests, getting the data from a page, etc.
[QUOTE=Xeon06;21359662]If you'd had looked it up, you'd have seen it's a class that has all the methods you need, POST requests, getting the data from a page, etc.[/QUOTE] I realize this, it was a valid response, but I was looking for a framework/API more than just basic functions.
I think we might start needing a bot subforum. [editline]09:36PM[/editline] Oh, and be prepared. I had to make some miscellaneous fixes to get my bot working.
[QUOTE=Agent766;21359932]Oh, and be prepared. I had to make some miscellaneous fixes to get my bot working.[/QUOTE] Huh? Like what?
To get [i]my[/i] bot working (AFAIremember). I had to pass cUrl to my function which was a pain to debug. Nothing is your codes problem as much as getting to work with my code's problem. I think the only real fix was initializing the page setting to 1. I don't know if this was actually a problem, but it looked like it could be. I'll check to see if there was anything else. I think most (all) errors were my own.
I have a Facepunch bot module in Lua, complete with ticker and posting support, if anyone prefers Lua.
Could i see it?
Yep. Just use your eyes.
[QUOTE=neos300;21358100]PHP would only work if you could upload your script to the server I think (or hacked the mysql data or files so you could do it remotely).[/QUOTE] PHP has a CLI. You can run it off your computer. Compwhizzi's gets the HTML page using cURL and parses that. The PHP program then runs client side.
I use Python to scrape data from webpages. The [url=http://codespeak.net/lxml/]lxml library[/url] is quite good but there's alternatives for that like beautifulsoup. For logging in I think [url=http://wwwsearch.sourceforge.net/mechanize/]Mechanize[/url] looks good. Haven't used it though. Better tutorials and examples can be found just by googling.
Sorry, you need to Log In to post a reply to this thread.