Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Question, how to deal with "creation_time" & "form_tok

$
0
0
I'm trying to build an app in VS2010 with VB.NET, I need to do several posts with the same information on different forums, something like a bot but I need to do this manually and doing it all by myself it takes alot of time so I decided to try this.

I'm using Live HTTP Headers, I post something manually (create new topic), then I look into it and I copy the string of the POST method... Then I copy this string to my code and it works fine, I can login and post...

But after a certain time I can't do it anymore, I think it's because the string must change, specially in the parameters "lastclick", "creation_time" and "form_token"... This is an example of the string I'm talking about:

subject=" & TextBoxSubject.Text & "&addbbcode20=100&message=" & TextBoxMessage.Text & "&lastclick=1361985462&post=Submit&attach_sig=on&creation_time=1361985462&form_token=229b24d265f1058324716672f0f9f7c126b2b58e&poll_title=&poll_option_text=&poll_max_options=1&poll_length=0



As you can see, those 3 parameters have those long numbers, which lastclick is the same than creation_time...

I'd like to know how I can get those numbers and generate them programatically so I can post today, and again in one week from now for example and so on.

Here is another part of my code, if you think there's an easier way or something let me know so I can try to avoid this situation:

Dim postpost As String = "" 'here goes the same string as above
    Dim encoding As New UTF8Encoding
    Dim byteData As Byte() = encoding.GetBytes(postpost)

    Dim request As HttpWebRequest = DirectCast(WebRequest.Create(here I put the link of the "new topic" button), HttpWebRequest)
    request.Method = "POST"
    request.ContentType = "application/x-www-form-urlencoded"
    request.Referer = ''here the link where I came from
    request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0"
    request.CookieContainer = logincookie 'this cookie has been saved at the beginning after the successfull login''
    request.ContentLength = byteData.Length

    Dim postreqstream As Stream = request.GetRequestStream()
    postreqstream.Write(byteData, 0, byteData.Length)
    postreqstream.Close()

    Dim response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
    Dim reader As New StreamReader(response.GetResponseStream)
    Dim thepost As String = reader.ReadToEnd
    RichTextBox1.Text = thepost


Thanks alot! Sorry for my english!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>