Skip to content

Instantly share code, notes, and snippets.

@onionhoney
Created December 4, 2019 06:58
Show Gist options
  • Save onionhoney/532c05a8fea424c82968af593b49916b to your computer and use it in GitHub Desktop.
Save onionhoney/532c05a8fea424c82968af593b49916b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
: ${2?"Usage: $0 n_channel which_channel(0-indexed)"}
if [ -n "$(ps -ef | grep "[p]ython3 event\_crawler\.py group_1853")" ] ; then
echo "script already running, aborting install";
exit 1;
fi
if [ ! -f ~/.local/bin/pip3 ]; then
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --user
~/.local/bin/pip3 install numpy --user
~/.local/bin/pip3 install pandas --user
~/.local/bin/pip3 install matplotlib --user
fi
cd ~
mkdir work
cd work
wget https://gist.githubusercontent.com/onionhoney/f71f64a572e6ec537324562225d626cd/raw/42a05bf03ce7340668e041b2c387fe6819290b4d/event_crawler.py
wget https://gist.githubusercontent.com/onionhoney/294aae0eb900125be1daf9a873bc4b18/raw/bad8d71e421f073a9add79d9a4a70251d6fed098/group_1853.csv
mkdir crawl
echo "Running $2 out of $1 channels"
nohup python3 event_crawler.py group_1853.csv $1 $2 > crawl.log 2> crawl.err &
echo "Script set up successfully, output to crawl.log"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment