Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Simple ugly proxy for Google Apps Scripts (in PHP)

This script was created for a Crypto-Currency Portfolio Tracking Sheet. But you can use it for any Google Drive file that is requesting data from an API (REST, etc.) which is limited to certain requests per IP.

Simply set you token and proxy URL and request data via the following method:

functionfetchUrl(url){varfinalUrl;varproxyUrl='http://api.yourdomain.com/proxy.php';// TODO Enter the complete URL to your proxy script e.g. varproxyToken='';// TODO Enter your tokenif(proxyUrl===''){finalUrl=url;}else{finalUrl=proxyUrl+"?url="+encodeURIComponent(url)+"&token="+encodeURIComponent(proxyToken);}varresponse=UrlFetchApp.fetch(finalUrl);varreturnText=response.getContentText();returnreturnText;}

You can use it like:

varreturnText=fetchUrl('https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=BTC,USD,EUR');// Do anything with your web request result like parsing it if it's JSON....:varparsedData=JSON.parse(returnText);

About

Google Script (Document, Sheets, ...) shares their IP addresses when doing calls to external hosts. This super simple php script allows users to use any webserver's IP address to do proxied requests without running in any IP restrictions/limitations.

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages