Last active
September 2, 2020 12:34
-
-
Save Florents-Tselai/6de0034c396a2c339bffb5f56f487a06 to your computer and use it in GitHub Desktop.
Want to have daily editions of the NYTimes, WSJ, Washington Post and the Economist daily in your Pocket ? Add this script as cron at 0 7 * * *
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
#!/usr/bin/env bash | |
for url in https://www.nytimes.com/section/todayspaper https://www.washingtonpost.com/todays_paper/updates https://economist.com https://www.wsj.com/news/types/bookshelf https://www.nytimes.com/section/books https://www.economist.com/books-and-arts/ https://newyorker.com https://theatlantic.com https://www.prospectmagazine.co.uk/category/arts-and-books https://www.washingtonpost/entertainment/books https://news.ycombinator.com/best; do | |
curl -L -H "Content-Type: application/json; charset=UTF-8" -H "X-Accept: application/json" \ | |
-d "{\"url\": \"$url\", \"consumer_key\": \"$POCKET_CONSUMER_KEY\",\"access_token\": \"$POCKET_ACCESS_TOKEN\"}" \ | |
-X POST "https://getpocket.com/v3/add" | |
done | |
# WSJ requires special care | |
for section in frontpage us world opinion business review offduty lifearts new-york; do | |
url=https://www.wsj.com/print-edition/$(date +'%Y%m%d')/$section | |
curl -L -H "Content-Type: application/json; charset=UTF-8" -H "X-Accept: application/json" \ | |
-d "{\"url\": \"$url\", \"consumer_key\": \"$POCKET_CONSUMER_KEY\",\"access_token\": \"$POCKET_ACCESS_TOKEN\"}" \ | |
-X POST "https://getpocket.com/v3/add" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment