Custom news scrapper
Project description
Essential
This package is a simple gatherer of different news from various APIs.
Currently, it sends all news gathered through e-mails to all the mail addresses from a database.
To send a simple mail to a target without using any database, use the function prepare_mail
from mail
.
Currently the gathered news are the following:
- Weather from Open Weather Map
- Top products from Product Hunt
- Trending repos from GitHub
- News from Guardian or Le Figaro depending on the language you decide to use (
en
orfr
)
The package can be installed with:
pip install smlep-news
Architecture
This project is divided in different packages:
figaro
: fetches french news from Le Figaro.github
: fetches trending repos from GitHub.guardian
: fetches us news from Guardian.mail
: calls gatherer from the other packages, format their content and send mail.product_hunt
: fetches top products from Product Hunt.runner
: gathers e-mail addresses from a database and send the gathered news through e-mails. This package configuration is relative to my own setup, if you want to use this program, you should bring changes to this package (or not use it).weather
: fetches weather from Open Weather Map. To choose the city you have to provide an ID, a list of city IDs can be downloaded here.
Credentials
This program uses APIs from different sources, and some of them require authentication. You'll have to provide API Keys in environment variables:
PH_CLIENT_ID
/PH_CLIENT_SECRET
: Product Hunt Api Client Id/Client Secret.WEATHER_KEY
: Open Weather Map Api Key.GUARDIAN_KEY
: Guardian Api Key.
All these keys can be obtained freely.
To send mails, you need an email account, the default configuration is for gmail
,
if you need to use another mail server, you should update the code. If you use
gmail
, you only need to provide some environment variables:
EMAIL_NAME
EMAIL_USERNAME
EMAIL_PASSWORD
Why and How I created this project
I wrote a small post about this project on my GitHub Page, you can read it here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for smlep_news-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca92d82eb97daa6b9d1eaa8035932548f8f15c7a280697c0d37660f44e398d73 |
|
MD5 | 31e8a3abafbf4ce6b561052034fbc3eb |
|
BLAKE2b-256 | f382ce42e8f7f995c7272b0f65f7e26f157a11c88e0f3054a38c998aa5292b17 |