newspie
所属分类:后台框架
开发工具:Python
文件大小:916KB
下载次数:0
上传日期:2023-06-06 14:55:26
上 传 者:
sh-1993
说明: 使用Flask构建的简约新闻聚合器,由新闻API提供支持。
(A minimalistic news aggregator built with Flask and powered by News API.)
文件列表:
LICENSE (1068, 2023-09-07)
Pipfile (187, 2023-09-07)
Pipfile.lock (32603, 2023-09-07)
_config.yml (27, 2023-09-07)
config.ini (194, 2023-09-07)
data (0, 2023-09-07)
data\countries.json (1147, 2023-09-07)
index.html (261, 2023-09-07)
news.py (7238, 2023-09-07)
requirements.txt (809, 2023-09-07)
static (0, 2023-09-07)
static\demo.gif (1010822, 2023-09-07)
templates (0, 2023-09-07)
templates\401.html (573, 2023-09-07)
templates\newspie.html (3737, 2023-09-07)
# NewsPie #
A minimalistic news aggregator built with [Flask](https://www.palletsprojects.com/p/flask/) and powered by [News API](https://newsapi.org/).
![Demo!](https://raw.githubusercontent.com/skamieniarz/newspie/master/static/demo.gif)
### [Link to live demo](https://skamieniarz.github.io/newspie/) ###
## Prerequisites: ##
1. [Python3](https://www.python.org).
2. Dependencies from `requirements.txt` or `Pipfile.lock` (preferably in a virtual env).
3. API key for [News API](https://newsapi.org/register). It's free for non-commercial projects (including open-source) and allows 500 requests per day. Once acquired, save it as `NEWS_API_KEY` environment variable or directly as string to `API_KEY` in `news.py`. Just don't share it or upload the code with it.
## Starting: ##
1. Run `python news.py` or `python3 news.py` (depending on the environment) in the terminal while in the root of the repository.
2. Go to [http://127.0.0.1:5000/](http://127.0.0.1:5000/) address in the web browser.
## Features: ##
1. Get top articles headlines and their URLs by country and/or category.
2. Search articles up to a month old. Looks for a given query in the titles. Language/country independent results. Relevancy decides.
3. Results received from News API are cached for 5 minutes.
4. Country saved as a cookie.
5. Responsive UI.
6. Dark mode/theme.
## Open-source used: ##
- [Flask](https://github.com/pallets/flask)
- [jinja](https://github.com/pallets/jinja)
- [Pico.css](https://github.com/picocss/pico)
- [requests](https://github.com/psf/requests)
- [requests-cache](https://github.com/reclosedev/requests-cache)
近期下载者:
相关文件:
收藏者: