2017 © Pedro Peláez
 

library botnews

Bot News

image

eduardorengifo/botnews

Bot News

  • Saturday, December 30, 2017
  • by eduardorengifo
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 43 % Grown

The README.md

BotNews

Build Status License: MIT Packagist Pre Release PHP from Packagist, (*1)

Botnews is a small PHP script to extract news from websites., (*2)

Installation

To install, use the following to pull the package in via Composer., (*3)

$ composer require eduardorengifo/botnews

Configuration

At the moment there are only two news sites configured. The same settings could be applied for all other available sites., (*4)

require_once __DIR__ . '/vendor/autoload.php';

$rppPostSlug = 'futbol/seleccion-peruana/video-ricardo-gareca-para-rpp-tenemos-que-tener-los-pies-sobre-la-tierra-en-el-mundial-noticia-1096914';
$rpp = new \BotNews\Sites\Rpp();

/** @var \BotNews\Models\Post $rppPost */
$rppPost = $rpp->getPost( $rppPostSlug );

/** @var \BotNews\Models\Page $rppPage */
$rppPage = $rpp->getPage('futbol');

Extend

To set up your own news site using the classes, models and BotNews interface you could use the following template., (*5)

use BotNews\BotNews;
use BotNews\Client;

class SiteName extends Client implements BotNews
{
    /**
     * @var string
     */
    protected $siteUrl = ''; // TODO: Place the web site url

    /**
     * @param string $slug
     *
     * @return Post
     */
    public function getPost( $slug )
    {
        // TODO: Your code configuration for post
    };

    /**
     * @param mixed $paged
     *
     * @return Page
     */
    public function getPage( $paged = 1 )
    {
        // TODO: Your code configuration for page
    };
}

License

BotNews is open-sourced software licensed under the MIT license, (*6)

The Versions

30/12 2017

dev-master

9999999-dev

Bot News

  Sources   Download

MIT

The Requires

 

The Development Requires

by Eduardo Rengifo

30/12 2017

v1.0.0

1.0.0.0

Bot News

  Sources   Download

MIT

The Requires

 

The Development Requires

by Eduardo Rengifo