Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Apps Script will not run in cURL?

I can execute this URL (which is a Google Apps Script) from the Browser:

https://script.google.com/macros/s/AKfycbyiZfWd10mmuaKPBF4zMMV4WJl_ZmLFrzCJCC_xZmviu-6z4lBS/exec

My goal is to send a GET to pushingbox that will then send the https: Pushingbox seems to give the same results as cURL. So for simplification, here is what I get from cURL:

curl https://script.google.com/macros/s/AKfycbyiZfWd10mmuaKPBF4zMMV4WJl_ZmLFrzCJCC_xZmviu-6z4lBS/exec
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://www.google.com/accounts/ServiceLogin?      service=wise&amp;passive=1209600&amp;continue=https://script.google.com/macros/s/AKfycbyiZfWd10mmuaKPBF4zMMV4WJl_ZmLFrzCJCC_xZmviu-6z4lBS/exec&amp;followup=https://script.google.com/macros/s/AKfycbyiZfWd10mmuaKPBF4zMMV4WJl_ZmLFrzCJCC_xZmviu-6z4lBS/exec">here</A>.
</BODY>

Why does it appear that when the HTTPS is sent from cURL it requires a login to run the Google Script? I put the Share on the Google Script to "even anonymous can edit"

Is there a way to get cURL (and hence pushingbox) to work?

Thank you very much for any help.

like image 676
user1255603 Avatar asked Sep 15 '25 23:09

user1255603


1 Answers

Adding the -L flag to curl will instruct it to follow the redirect:

curl -X GET -L https://script.google.com/macros/s/AKfycbyiZfWd10mmuaKPBF4zMMV4WJl_ZmLFrzCJCC_xZmviu-6z4lBS/exec

Hope this helps!

like image 137
Kyle Fransham Avatar answered Sep 19 '25 14:09

Kyle Fransham