Tag: php

Load data into Google Spreadsheet from PHP

Lets say you have a PHP script that returns a value, based on a query string: Getting the result of that PHP script into Google Sheets is rather easy. Open Tools > Script Editor in Google Sheets and create a function like this: function getMyQueryValue(value) { var response = UrlFetchApp.fetch(“https://mysite.com.com/query.php?string=” + value); Logger.log(response.getContentText()); return JSON.parse(response); […]

How to run PhantomJS from PHP

I was adding PhantomJS into an existing PHP script and running passthru(‘phantomjs …..’); just wasn’t working. A few tips: If you’re running the script locally, add export DISPLAY=:0 to the PHP passthru() If you’re running the script on a remote host make sure someting like Xvfb is installed, then run nohup Xvfb :40 -ac -screen 0 1600x4000x24 & […]