| Blockland Forums > Modification Help |
| Post to blockland forums with HTTP Objects? |
| << < (4/10) > >> |
| Kalphiter:
Start with this, in the filter bar: http.host == forum.blockland.us |
| Port:
--- Quote from: Port on May 28, 2012, 07:08:50 AM ---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. --- End quote --- |
| Lugnut:
--- Quote from: Kalphiter on May 28, 2012, 02:33:02 PM ---Start with this, in the filter bar: http.host == forum.blockland.us --- End quote --- oh, thanks. that'll be useful. --- Quote from: Port on May 28, 2012, 11:39:58 PM --- --- End quote --- saw this, meant to post, didn't :c Thanks for this, it looks like I have some reading to do on syntax. |
| Brian Smithers:
Bad idea, Badspot will shove his snake so far up your ass your bowl movements will commit Self Delete probably ban you. |
| Kalphiter:
The amount of people in this thread that think this is some atrocious deed makes me laugh. |
| Navigation |
| Message Index |
| Next page |
| Previous page |