2019-07-05 05:18:44 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
OLD=$PWD
|
2019-07-05 07:43:00 +08:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
|
|
|
|
cd $DIR
|
2019-07-05 05:18:44 +08:00
|
|
|
|
|
|
|
if [ -d "/usr/local/crawler-venv" ]
|
|
|
|
then
|
|
|
|
source /usr/local/crawler-venv/bin/activate
|
|
|
|
fi
|
|
|
|
|
|
|
|
FOLDER=$(date +"%Y-%m")
|
|
|
|
mkdir -p "$OLD/$FOLDER"
|
|
|
|
|
|
|
|
DAY=$(date +"%d")
|
|
|
|
mkdir -p "$OLD/$FOLDER/$DAY/facebook"
|
|
|
|
|
|
|
|
TIME=$(date +"%s")
|
|
|
|
|
|
|
|
source ~/.secrets
|
|
|
|
|
|
|
|
scrapy crawl events -a email="$FACEBOOK_EMAIL" -a password="$FACEBOOK_PASSWORD" -a page="$1" -o "$OLD/$FOLDER/$DAY/facebook/$TIME_$1.csv"
|