woid

所属分类:后台框架
开发工具:Python
文件大小:295KB
下载次数:0
上传日期:2021-06-10 21:31:11
上 传 者sh-1993
说明:  简单的新闻聚合器实时显示热门新闻
(Simple news aggregator displaying top stories in real time)

文件列表:
.editorconfig (744, 2019-01-10)
.env.example (66, 2019-01-10)
LICENSE (11358, 2019-01-10)
manage.py (540, 2019-01-10)
requirements.txt (25, 2019-01-10)
requirements (0, 2019-01-10)
requirements\base.txt (135, 2019-01-10)
requirements\dev.txt (41, 2019-01-10)
requirements\docs.txt (38, 2019-01-10)
requirements\prod.txt (44, 2019-01-10)
requirements\tests.txt (78, 2019-01-10)
setup.cfg (554, 2019-01-10)
tox.ini (580, 2019-01-10)
woid (0, 2019-01-10)
woid\__init__.py (0, 2019-01-10)
woid\apps (0, 2019-01-10)
woid\apps\__init__.py (0, 2019-01-10)
woid\apps\accounts (0, 2019-01-10)
woid\apps\accounts\__init__.py (0, 2019-01-10)
woid\apps\accounts\migrations (0, 2019-01-10)
woid\apps\accounts\migrations\__init__.py (0, 2019-01-10)
woid\apps\accounts\models.py (0, 2019-01-10)
woid\apps\accounts\views.py (0, 2019-01-10)
woid\apps\core (0, 2019-01-10)
woid\apps\core\__init__.py (0, 2019-01-10)
woid\apps\core\migrations (0, 2019-01-10)
woid\apps\core\migrations\__init__.py (0, 2019-01-10)
woid\apps\core\models.py (0, 2019-01-10)
woid\apps\core\templatetags (0, 2019-01-10)
woid\apps\core\templatetags\__init__.py (0, 2019-01-10)
woid\apps\core\templatetags\startswith.py (254, 2019-01-10)
woid\apps\core\views.py (228, 2019-01-10)
woid\apps\services (0, 2019-01-10)
woid\apps\services\__init__.py (0, 2019-01-10)
woid\apps\services\context_processors.py (160, 2019-01-10)
woid\apps\services\crawlers.py (9925, 2019-01-10)
woid\apps\services\fixtures (0, 2019-01-10)
... ...

# Woid [![Python Version](https://img.shields.io/badge/python-3.6-brightgreen.svg)](https://python.org) [![Django Version](https://img.shields.io/badge/django-2.1-brightgreen.svg)](https://djangoproject.com) **Table of Contents** * [Running Locally](#running-locally) * [Supported Services](#supported-services) * [Crawlers](#crawlers) * [API Key Required: The New York Times](#the-new-york-times) * [API Key Required: Product Hunt](#product-hunt) * [Cron Jobs](#cron-jobs) * [License](#license) ## Running Locally First, clone the repository to your local machine: ``` git clone https://github.com/vitorfs/woid.git ``` Install the requirements: ```bash pip install -r requirements/dev.txt ``` Apply the migrations: ```bash python manage.py migrate ``` Load the initial data: ```bash python manage.py loaddata services.json ``` Finally, run the development server: ```bash python manage.py runserver ``` The site will be available at **127.0.0.1:8000**. ## Supported Services Currently Woid crawl the following services to collect top stories: * Hacker News `hn` * Reddit `reddit` * GitHub `github` * The New York Times `nytimes` * Product Hunt `producthunt` ## Crawlers You can run the crawlers manually to collect the top stories using the following command: ```bash python manage.py crawl reddit ``` You can pass multiple services at once: ```bash python manage.py crawl reddit hn nytimes ``` Valid values: `hn`, `reddit`, `github`, `nytimes`, `producthunt`. ### The New York Times To crawl The New York Times you will need an API key. You can register one application at [developer.nytimes.com](https://developer.nytimes.com). ### Product Hunt Product Hunt require an API key to consume their API. You can register one application at [api.producthunt.com/v1/docs](https://api.producthunt.com/v1/docs) ### Cron Jobs You can set up cron jobs to execute the crawlers periodically. Here is what my crontab looks like: ``` */5 * * * * /home/woid/venv/bin/python /home/woid/woid/manage.py crawl reddit hn producthunt >> /home/woid/logs/cron.log 2>&1 */30 * * * * /home/woid/venv/bin/python /home/woid/woid/manage.py crawl nytimes github >> /home/woid/logs/cron.log 2>&1 ``` ## License The source code is released under the [Apache 2.0 license](https://github.com/vitorfs/woid/blob/master/LICENSE).

近期下载者

相关文件


收藏者