Skip to content

aleksei4er/task-news-parser

Repository files navigation

Task News Parser

GitHub Workflow Status styleci

Packagist Packagist Packagist

Lumen package for test task

Installation

Install via composer

composer require aleksei4er/task-news-parser

Setup enviroment variables

TASK_NEWS_PARSER_NEWSAPI_KEY=YOUR_KEYNAME (visit https://newsapi.org/)
TASK_NEWS_PARSER_TIMEOUT=15
TASK_NEWS_PARSER_NEWSAPI_URL=http://newsapi.org/v2/everything
TASK_NEWS_PARSER_KEYWORDS=bitcoin,litecoin,ripple,dash,ethereum (one article for each keyword by default)

Run migrations

php artisan migrate

Make sure this lines are uncommented in bootstrap/app.php

$app->withFacades();
$app->withEloquent();

Register service provider in the same file

$app->register(Aleksei4er\TaskNewsParser\ServiceProvider::class);
$app->register(Dingo\Api\Provider\LumenServiceProvider::class);

Usage

You can create schedule for console command or run it manually

php artisan task:news-parser

Endpoint to get articles

/api/articles

Also there are three kinds of grouping

/api/articles?groupBy=source /api/articles?groupBy=keyword /api/articles?groupBy=date

Security

If you discover any security related issues, please email instead of using the issue tracker.

Credits

This package is bootstrapped with the help of melihovv/laravel-package-generator.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages