A couple of months back SparkOut was kind enough to help me mimic what Google Forms does using "post ... to url" in Revolution. Seemed to work fine - the data shows up in Google Spreadsheets quite nicely. Except... Lately however, and almost without fail (there HAVE been a few exceptions, but very few) only every *other* post seems to work. I get "error bad request" on 1st, 3rd, 5th, or on the 2nd, 4th, 6th, depending on -- apparently the phase of the moon! It doesn't seem to matter how much time there is in between posts. Whether I submit fast (< 1 second between posts) or slow (couple of minutes between), it takes every other one. Just for fun, I went back to the original actual google form and submitted as fast as I possibly could (submit, backspace, submit, etc) and it took it every time! This is exactly the same form as I'm mimicking, so the http address is identical. So strange! Here's one variation on the code (I've tried a couple of different ways of encoding for url, and they all have the same result)...
Code: Select all
on mouseup
local tFieldName1, tFieldName2, tFieldValue1, tFieldValue2, tDatatoPost
put "entry.2.single" into tFieldName1
put "entry.3.single" into tFieldName2
put "SparkOut" into tFieldValue1
put 999 into tFieldValue2
put libUrlFormData (tFieldName1, tFieldValue1, tFieldName2, tFieldValue2) into tDataToPost
post tDatatoPost to URL ("http://spreadsheets.google.com/formResponse?formkey=clN1U2kxSDdOYWMtY2ltTTdna0xkUlE6MA..")
answer it
end mouseup
I initially discovered this in a loop when I was posting 5 lines from a data set in rapid succession. I then turned off the loop and submitted (slowly) one line at a time. Yup, every *other* one! I've tried it multiple times over a period of 24 hours. Is there something that I've stupidly overlooked? I've tried different sorts and amounts of data in the post, and google will take anything I submit but only on every *other* post. Sometimes it's the first post. Sometimes the second. If it works on the first, it almost never works on the second, and vice versa. I created a new spreadsheet (i.e., used a different address to post to), and again, takes every other one!
Help!
Mark
EDIT------------
For what it's worth, this was the original code that I was using when the problem started. Different data, different number of vars, and different way of encoding for url (i.e, by hand), but the result is the same. Every other post works!
Code: Select all
on mouseUp
global gDATA
repeat with Y = 1 to 5
put empty into myDATA
repeat with X = 1 to 5
put "entry." & X & ".single=" & item X of line Y of gDATA & "&" after myDATA
end repeat
delete last char of myDATA
post myDATA to URL ("http://spreadsheets.google.com/formResponse?formkey=clN1U2kxSDdOYWMtY2ltTTdna0xkUlE6MA.. ")
answer it
end repeat
end mouseUp