2017 © Pedro Peláez
 

library rssreader

PHP class for getting an rss-feed

image

petlid/rssreader

PHP class for getting an rss-feed

  • Sunday, May 22, 2016
  • by PetLid
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

rssreader

Build Status Scrutinizer Code Quality Code Coverage, (*1)

Introduction

A small SimplePie wrapper-class designed for usage with the Anax/MVC framework, generates HTML for an RSS-feed., (*2)

By Petrus Lidholm | pelle@lidholm.se, (*3)

Installation

Since rssreader is designed for Anax/MVC framework and is dependant on it, it is required that you get the framework before following the steps below. Anax/MVC is located at https://github.com/mosbth/Anax-MVC.git., (*4)

rssreader also uses SimplePie, include it in the composer.json located in the root :"require": { "simplepie/simplepie": "dev-master" }., (*5)

Download

You can either download this repo as a .zip-file or you can use composer to get the package through packagist by adding the following line in the composer.json located in the root:, (*6)

"require": { "petlid/rssreader": "dev-master" }., (*7)

Setup

To use rssreader you'll have to set it up as a controller in Anax/MVC,, (*8)

$di->set('RssController', function() use ($di) {
    $controller = new \petlid\RSSReader\RSSReaderController(:url);
    $controller->setDI($di);
    return $controller;
});

Important replace :url with the url (in quotation marks) of the RSS-feed you'd like to display., (*9)

To view the RSS-feed you can add a route to the viewAction in your front controller like this:, (*10)

$app->router->add('rss', function() use ($app) {
    $app->dispatcher->forward([
        'controller' => 'RSS',
        'action'     => 'view',
        'params'     => [
            'noOfItems' => :noOfItems
        ],
    ]);
});

the name of the added route is irrelevant. To access the route simply go to your front controller, for example index.php, and add '/rss' to the url., (*11)

Notice :noOfItems is the number of rss-articles you want in your feed. It is optional (and defaults to 5)., (*12)

Lastly, copy the contents of petlid\rssreader\view into Anax-MVC\app\view., (*13)

Optional

You can choose to get some basic styling of the RSS-feed by copying the catalog petlid\rssreader\css into Anax-MVC\webroot and adding the stylesheet in the front controller from which you call $app->theme->addStylesheet('css/rss.css');, (*14)

The Versions

22/05 2016

dev-master

9999999-dev

PHP class for getting an rss-feed

  Sources   Download

MIT

The Requires

 

by Petrus Lidholm

22/05 2016

v3.0

3.0.0.0

PHP class for getting an rss-feed

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Petrus Lidholm

22/05 2016

v2.0

2.0.0.0

PHP class for getting an rss-feed

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Petrus Lidholm

19/05 2016

v1.0

1.0.0.0

PHP class for getting an rss-feed

  Sources   Download

MIT

The Requires

 

by Petrus Lidholm

18/05 2016

v0.1

0.1.0.0

PHP class for getting an rss-feed

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Petrus Lidholm