Trying to automate mass PM on a site using Javascript - puzzling dilemma

dtang4

Regular Member
Joined
Apr 7, 2010
Messages
344
Reaction score
59
I am trying to mass PM thousands of members on this one social networking site.

Their site has little security, so I am able to replicate the HTML PM submission form locally... submit it... and have the message go through.

So, for each of the users I scrape, I am trying to auto-generate an HTML PM form, auto-populate the form fields, and then auto-submit the POST form.

When I auto-submit using Javascript (e.g. "document.forms[$i].submit()"), the form doesn't seem successfully submit. However, if I were to just output the form and then manually click the submit button, the message does go through.

Any idea why the Javascript submission wouldn't work?

Thanks.
 
Last edited:
Check with firebug/dragonfly for Javascript possible errors.
 
What browser are you using?
How are you inserting the JS? Are you doing it via the url bar?

(some browsers like FF don't work/like JS in the url bar).
 
Its more likely cause on the onsubmit property the form has. I am pretty sure the site has some sort of javascript that runs right before it submits the form , its usually a mix of keyboard,mouse logs associated with the time they were press/move with some sort of algorithm implemented to it .
 
There might be hidden fields containing specific values that are generally used in submit forms in order to prevent 3rd party submissions. Search on the html page for "hidden" that might help.
 
Seems inefficient. If you can replicate the form, then why not post directly? Even using CURL would allow you to skip out on the html side and the time cost of javascript.
 
The form doesn't have any additional hidden fields or onsubmit property. I'm sure of this, because I replicated the form's HTML locally and stripped away all the extraneous code. (When I say locally, I mean I have the HTML file on my own apache localhost. I'm not injecting Javascript or anything via the URL bar into the social network site.)

The only difference is the message only goes through if I manually click the submit button. If I insert a line of Javascript to submit it automatically, it no longer works.

I tried cURL, but it wasn't working (maybe for the same reason the javascript didn't work). The time cost isn't a big deal for me. As long as its automated, I don't care if it just runs for a few hours in the background.
 
Well, you can always use Imacros to click the button... I use it for simple tasks quite often instead of coding standalone apps, because it requires less effort
 
Last edited:
The javascript submit should work; have a look here for a live example:

http : // jsfiddle . net / 5uJmm /

What you probably do is calling the Javascript before the form is rendered; that trigger a Javascript error and the form is not submitted.
Check it againg and be sure to call the Javascript after the form declaration.
 
Back
Top