2017 © Pedro Peláez
 

october-plugin oc-rssfetcher-plugin

Fetches RSS headlines from various sources to put on your website

image

vdlp/oc-rssfetcher-plugin

Fetches RSS headlines from various sources to put on your website

  • Friday, July 20, 2018
  • by vdlp
  • Repository
  • 6 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

, (*1)

Vdlp.RssFetcher

Fetches RSS/Atom feeds to put on your website. It can be automated using a cronjob or triggered manually. , (*2)

, (*3)

Installation

composer require vdlp/oc-rssfetcher-plugin

RSS & Atom feeds

The plugin uses the laminas/laminas-feed package to parse the RSS and/or Atom feeds. For more information on this package goto https://docs.laminas.dev/laminas-feed/, (*4)

Components

The plugin is configured with 4 example sources and has a few components which help you to display items and/or sources on your website., (*5)

Items

Shows a list of most recent RSS items limited on the maximum number of items provided by you., (*6)

An example of implementation code in your CMS page:, (*7)

title = "A list of items"
url = "/items"
layout = "default"
is_hidden = 0

[rssItems]
maxItems = 10
==
{% component 'rssItems' %}

PaginatableItems

Shows a list of most recent RSS items with an additional paginator element., (*8)

An example of implementation code in your CMS page:, (*9)

title = "A list of items (paginatable)"
url = "/items"
layout = "default"
is_hidden = 0

[rssPaginatableItems]
itemsPerPage = 3
==
{% component 'rssPaginatableItems' %}

Sources

Shows a list of sources., (*10)

An example of implementation code in your CMS page:, (*11)

title = "A list of sources"
url = "/sources"
layout = "default"
is_hidden = 0

[rssSources]
==
{% component 'rssSources' %}

Events

To manipulate RSS items there are a few events which can be used: - vdlp.rssfetcher.item.processTitle - vdlp.rssfetcher.item.processContent - vdlp.rssfetcher.item.processLink, (*12)

Use them like this:, (*13)

Event::listen('vdlp.rssfetcher.item.processTitle', function (&$title) {
    $title = $title . 'A';
});

Event::listen('vdlp.rssfetcher.item.processContent', function (&$content) {
    $content = strip_tags($content);
});

Reporting Widgets

This plugin contains also a RSS Headlines widget to show the latest headlines on your Dashboard. This widget has three configurable properties: maxItems, title and dateFormat., (*14)

Cronjob

There are many ways to configure a cronjob. Here's a basic example of cronjob configuration line:, (*15)

5/* * * * php path/to/artisan vdlp:fetch-rss >> /dev/null 2>&1

The above line takes care of fetching all sources every 5 minutes., (*16)

The vdlp:fetch-rss command takes an optional source_id argument. Provide the source ID if you want to fetch only 1 source at that time., (*17)

Execute from code

In your plugin code you can also use the following code to execute the Artisan command:, (*18)

<?php

use Artisan;
// ...

Artisan::call('vdlp:fetch-rss', ['source' => 2]);

Or using the RssFetcher singleton:, (*19)

RssFetcher::instance()->fetch(2);

Issues

If you have issues using this plugin. Please create an issue on GitHub or contact us at octobercms@vdlp.nl., (*20)

Contribution

Any help is appreciated. Or feel free to create a Pull Request on GitHub., (*21)

The Versions

20/07 2018

dev-develop

dev-develop

Fetches RSS headlines from various sources to put on your website

  Sources   Download

MIT

The Requires

 

by Alwin Drenth

plugin cms rss october

18/07 2018

dev-master

9999999-dev

Fetches RSS headlines from various sources to put on your website

  Sources   Download

MIT

The Requires

 

by Alwin Drenth

plugin cms rss october

18/07 2018

1.0.1

1.0.1.0

Fetches RSS headlines from various sources to put on your website

  Sources   Download

MIT

The Requires

 

by Alwin Drenth

plugin cms rss october

18/07 2018

1.0.0

1.0.0.0

Fetches RSS headlines from various sources to put on your website

  Sources   Download

MIT

The Requires

 

by Alwin Drenth

plugin cms rss october