Last active
August 29, 2015 14:22
-
-
Save codeck/e50e46af880d9fbb7cf3 to your computer and use it in GitHub Desktop.
A simple poll-based REST API data fetcher script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# edit fetsh.lst as a TSV file and press 'q' to stop polling | |
# poll period: 1 second | |
# | |
while [ 1 ] | |
do | |
read -t 1 -n 1 char | |
if [[ $char == 'q' ]] | |
then | |
break | |
else | |
parallel -j 8 --progress --colsep '\t' -a fetch.lst curl -s {1} -o {2} | |
git add -A data/ | |
git commit -m "auto message: $(date +%s)" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment