🚀 This program is designed to scrape news articles related to coyote attacks within a specified time period using the Newscatcher API. The program saves the extracted data into a SQLite database.
Note: The script requires an API key for Newscatcher.
git clone https://github.com/Biodiversity-CatTracker2/Coyote-Attacks-News.git
cd Coyote-Attacks-News
pip install -r requirements.txt
usage: main.py [-h] -d DB_NAME -s START_DATE -e END_DATE [--no-sleep]
options:
-h, --help show this help message and exit
-d DB_NAME, --db-name DB_NAME
Name of the database file
-s START_DATE, --start-date START_DATE
Search from this date
-e END_DATE, --end-date END_DATE
Search until this date
--no-sleep No sleep
mv .env.example .env
nano .env
python main.py -d <DB_NAME> -s <START_DATE> -e <END_DATE>
- First, rename and edit
run.sh.example
content.
mv run.sh.example run.sh
nano run.sh
- Then, run with:
bash run.sh
python main.py -d db.sqlite3 -s '2023-04-02' -e '2023-04-17'