| Blockland Forums > Modification Help |
| Post to blockland forums with HTTP Objects? |
| << < (3/10) > >> |
| Port:
Meh. First of all, you'll need to grab a login cookie. Here's something I wrote in Python: --- Code: ---def get_login_cookie(username, password): body = urllib.urlencode('user=%s&passwrd=%s&cookieneverexp=1' % (username, password)) headers = { 'Host': 'forum.blockland.us', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0', 'Connection': 'close', 'Referer': 'http://forum.blockland.us/index.php?action=login;wap2', 'Content-Type': 'application/x-www-form-urlencoded' } urllib2.urlopen(urllib2.Request('http://forum.blockland.us/index.php?action=login2;wap2', body, headers)) --- End code --- So basically, you'll need to send a POST request with some specific headers to http://forum.blockland.us/index.php?action=login2;wap2 with the following data: user=username&passwrd=password&cookieneverexp=1 Once you get some data, look through the headers for a Set-Cookie header and do stuff with that. You pretty much only need to do this once because of cookieneverexp, but you can do it again if the session somehow becomes invalid. When you need to post something, such as a reply to a topic, first do a GET for http://forum.blockland.us/index.php?action=post;topic=195212.0;num_replies=8;wap2 (that's for this topic) with your cookie passed as a Cookie header and look through all the input elements. They have some information (name, value) that you'll need to save, such as sc and seqnum. Then, change some of the values you got, such as message and send a POST request to http://forum.blockland.us/index.php?action=post2;start=0;board=25 (still taking this topic as example destination) with your cookie passed as a Cookie header. For the data, you need to use the information you saved previously. Build it as follows: var_name=var_value&something_else=dunno&foo=bar It's important that you pass all the information you got in the GET request previously or you might session errors or start a new topic instead of simply making a reply. All the links I stated except for login depend on where you want to post. You can get the URL for the initial GET request from the REPLY button, and the URL for the POST request from the action attribute of the form element on the page you got from the initial GET request. |
| xXBeibsFan119Xx:
--- Quote from: Port on May 28, 2012, 03:29:54 AM --- --- End quote --- RTB |
| Ipquarx:
--- Quote from: xXBeibsFan119Xx on May 28, 2012, 12:35:01 PM ---RTB --- End quote --- My sides are exploding That's Ephialtes damnit! It's considered automated if you're doing it through script. Trust me, it's not a good idea. You'll be banned If you use it I can guarentee. |
| Greek2me:
I'm pretty sure that what he's trying to do is make an in-game forum browser, so it might be allowed. |
| Lugnut:
--- Quote from: Greek2me on May 28, 2012, 01:18:42 PM ---I'm pretty sure that what he's trying to do is make an in-game forum browser, so it might be allowed. --- End quote --- maybe tied to only one forum topic, but.. yeah, that's what i'm trying to do |
| Navigation |
| Message Index |
| Next page |
| Previous page |