illpastethat

POST to google form

Aug 13th, 2012
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.31 KB | None | 0 0
  1. ;This is as far as I got... it's SSL now.  Not sure what isn't working with it now.
  2. ;I would look at it later, but I'm going to sleep now.
  3. ;using the form at https://docs.google.com/spreadsheet/embeddedform?formkey=dENEU2dXdkZLR01wYkVSclpxRTNYanc6MQ as example
  4.  
  5. alias fillform {
  6.   set %test $urlencode($1-)
  7.   sockopen -e fillform https://docs.google.com 80
  8. }
  9.  
  10. on *:sockopen:fillform:{
  11.   var %x sockwrite -n $sockname
  12.   ;now looking at chrome developer console online I saw the request payload for answering just the first question is
  13.   ;entry.0.single=THE_ANSWER&entry.1.single=&pageNumber=0&backupCache=&submit=Submit
  14.   ;so I am just going to replace that answer part with what I filled above with $1- (assuming you use /fillform this is the answer to question 1)
  15.   set %test $+(entry.0.single=,%test,&entry.1.single=&pageNumber=0&backupCache=&submit=Submit)
  16.   echo -a %test
  17.   %x POST /spreadsheet/embeddedform?formkey=dENEU2dXdkZLR01wYkVSclpxRTNYanc6MQ HTTP/1.1
  18.   %x Host: https://docs.google.com
  19.   %x Content-Length: $len(%test)
  20.   ;the length of test is the content length because that's what i'm posting
  21.   %x Content-type: application/x-www-form-urlencoded; charset=UTF-8
  22.   %x
  23.   %x %test
  24. }
  25.  
  26. on *:sockread:fillform:{
  27.   if ($sockerr) { echo -a $sockerr | return }
  28.   sockread &t
  29.   echo -a $bvar(&t,1-).text
  30. }
Add Comment
Please, Sign In to add comment