I have a shell script I made to pull the amount of players listed on a game website for example. I took the number and added a timestamp and put it on google spreadsheets so I could make a graph over time to track data. The only problem is to run that, I need to keep my computer on, I’m going to guess you can do this with a google script of some kind but I have no idea how to begin doing that.
The shell script I used was:
wget --output-document=- http://runescape.com/title.ws 2>/dev/null \
| grep PlayerCount \
| head -1l \
| sed 's/^[^>]*>//' \
| sed "s/currently.*$/$(date '+%m\/%d\/%Y %H:%M:%S')/" \
| cut -d">" -f 3,4 \
| sed 's/<\/span>//' \
| sed 's/,//' \
| awk '{printf "%s %s,%s,%s\n", $3, $4, $1, $2}'
Output example: 11/21/2012 01:02:22,52833,people
What I wanted was to have it auto pull that number and store it on a cell every 2 minutes for example. But I am not sure how easy it is or where to begin.
Then it would look like https://i.stack.imgur.com/Qp2rJ.png
It’s possible that if you may hit a quota limitation when doing this. But here’s how I’d do it.
Open a Google Spreadsheet, then click the menu Tools > Script Editor, paste the above code and save. Still on the script editor, click Resources > Current script’s triggers. Then set this function to run on a time-driven trigger.