Skip to content

Instantly share code, notes, and snippets.

@jdennes
Last active April 29, 2016 16:56
Show Gist options
  • Save jdennes/e57592c2e87dc2e0187054262732bed6 to your computer and use it in GitHub Desktop.
Save jdennes/e57592c2e87dc2e0187054262732bed6 to your computer and use it in GitHub Desktop.
Example of how to pipe output from `script/scrape` provided by https://github.com/jdennes/buienalarm into `spark`
$ script/scrape enschede
===> Scraping Buienalarm.nl...
Projected rainfall for the next two hours in enschede:
18:40 - 0.05mm/hour (light)
18:45 - 0.05mm/hour (light)
18:50 - 0.09mm/hour (light)
18:55 - 0.11mm/hour (light)
19:00 - 0.13mm/hour (light)
19:05 - 0.21mm/hour (light)
19:10 - 0.09mm/hour (light)
19:15 - 0.08mm/hour (light)
19:20 - 0.06mm/hour (light)
19:25 - 0.09mm/hour (light)
19:30 - 0.09mm/hour (light)
19:35 - 0.06mm/hour (light)
19:40 - 0.01mm/hour (light)
19:45 - 0.00mm/hour (none)
19:50 - 0.00mm/hour (none)
19:55 - 0.00mm/hour (none)
20:00 - 0.00mm/hour (none)
20:05 - 0.00mm/hour (none)
20:10 - 0.00mm/hour (none)
20:15 - 0.00mm/hour (none)
20:20 - 0.00mm/hour (none)
20:25 - 0.00mm/hour (none)
20:30 - 0.00mm/hour (none)
20:35 - 0.00mm/hour (none)
20:40 - 0.00mm/hour (none)
$ script/scrape enschede | grep 'mm/hour' | cut -d ' ' -f3 | sed 's/mm\/hour//' | awk '{print $1 * 100}' | spark
▂▂▄▄▅█▄▃▃▄▄▃▁▁▁▁▁▁▁▁▁▁▁▁▁
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment