rstormsf / zapier-selenium

Break 15 min wait in Zapier
1 stars 1 forks source link

Clever! #1

Open bryanhelmig opened 9 years ago

bryanhelmig commented 9 years ago

This is pretty clever and we definitely commend you! I would kindly ask everyone to maybe not do this [0] - we too are subject to API limits. :-)

[0] Or at least don't go faster than the fastest 5 minute polling interval we already have.

rstormsf commented 9 years ago

Other way would be to do something like this: curl 'https://zapier.com/api/v3/nodes/ZAP_ID/run' -X POST -H 'Cookie: csrftoken=CSRFTOKEN; zapsession=ZAPSESSION; zapforeversession=ZAPFOREVERSESSION; fs_uid=FS_UID' -H 'X-NewRelic-ID: NEWRELIC' -H 'Origin: https://zapier.com' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,ru;q=0.6' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2302.2 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://zapier.com/app/dashboard' -H 'X-CSRFToken: CSRFTOKEN' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Content-Length: 0' -H 'DNT: 1' --compressed

Few variables you can get from cookies: copy paste into the request above:

ZAP_ID - you can see it from you ZAP url when you login and click on zap CSRFTOKEN - from cookies ZAPSESSION - from cookies ZAPFOREVERSESSION - from cookies FS_UID - from cookies

Another way (if zapier) would change DOM ids/classes, just use http://www.sikuli.org/

So, in beatiful way of doing this would be: 1)Have browser to just login and collect new cookies and save them(once a day) 2)Run curl scripts with new cookies :-) 3)Get rid of browser and use phantomjs 4)Profit!