PHPackages                             vdlp/oc-rssfetcher-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. vdlp/oc-rssfetcher-plugin

ActiveOctober-plugin

vdlp/oc-rssfetcher-plugin
=========================

Fetches RSS headlines from various sources to put on your website.

4.0.0(9mo ago)613.5k↓50%4GPL-2.0-onlyPHPPHP ^8.0.2

Since Jul 18Pushed 9mo ago9 watchersCompare

[ Source](https://github.com/vdlp/oc-rssfetcher-plugin)[ Packagist](https://packagist.org/packages/vdlp/oc-rssfetcher-plugin)[ RSS](/packages/vdlp-oc-rssfetcher-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (25)Used By (0)

 [![](https://camo.githubusercontent.com/f7a02a721b00b799eea40e6ffc2f2bdf5551cf02e41354725ebef1765b8263cc/68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f69636f6e732f56646c702e527373466574636865722e737667)](https://camo.githubusercontent.com/f7a02a721b00b799eea40e6ffc2f2bdf5551cf02e41354725ebef1765b8263cc/68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f69636f6e732f56646c702e527373466574636865722e737667)

Vdlp.RssFetcher
===============

[](#vdlprssfetcher)

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

 [![](https://camo.githubusercontent.com/df9ee671a770964bcd92f8bac26ee9564e0db7d18f7dfd25bec583ef380a5900/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f76646c702f6f632d727373666574636865722d706c7567696e)](https://camo.githubusercontent.com/df9ee671a770964bcd92f8bac26ee9564e0db7d18f7dfd25bec583ef380a5900/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f76646c702f6f632d727373666574636865722d706c7567696e) [![](https://camo.githubusercontent.com/92997e0a1a63ec329b31310ed752522f1eabc0bcedb904679e141c66833350fb/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f76646c702f6f632d727373666574636865722d706c7567696e)](https://camo.githubusercontent.com/92997e0a1a63ec329b31310ed752522f1eabc0bcedb904679e141c66833350fb/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f76646c702f6f632d727373666574636865722d706c7567696e) [![](https://camo.githubusercontent.com/208f38f3ceb9eb0c34d058a1ca97f25ddfca1ba2acfc8940d590bdbfb99056bf/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76646c702f6f632d727373666574636865722d706c7567696e2f6c6174657374)](https://camo.githubusercontent.com/208f38f3ceb9eb0c34d058a1ca97f25ddfca1ba2acfc8940d590bdbfb99056bf/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76646c702f6f632d727373666574636865722d706c7567696e2f6c6174657374) [![](https://camo.githubusercontent.com/2088cdd4e2042b99948eeb3c55ca116388c3effea29d50144586714fb5ef9b6c/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f76646c702f6f632d727373666574636865722d706c7567696e)](https://camo.githubusercontent.com/2088cdd4e2042b99948eeb3c55ca116388c3effea29d50144586714fb5ef9b6c/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f76646c702f6f632d727373666574636865722d706c7567696e) [![](https://camo.githubusercontent.com/5457e68a1051820661648bd93ffaf69f8ab513920dd19c261ff3ac5a646d0ed2/68747470733a2f2f62616467656e2e6e65742f62616467652f636d732f4f63746f626572253230434d53)](https://camo.githubusercontent.com/5457e68a1051820661648bd93ffaf69f8ab513920dd19c261ff3ac5a646d0ed2/68747470733a2f2f62616467656e2e6e65742f62616467652f636d732f4f63746f626572253230434d53) [![](https://camo.githubusercontent.com/8ef1333110cedb8be792e165e201c69d776d92c196b7a26938e50ad4ddfb0f84/68747470733a2f2f62616467656e2e6e65742f62616467652f747970652f706c7567696e)](https://camo.githubusercontent.com/8ef1333110cedb8be792e165e201c69d776d92c196b7a26938e50ad4ddfb0f84/68747470733a2f2f62616467656e2e6e65742f62616467652f747970652f706c7567696e)

Installation
------------

[](#installation)

```
composer require vdlp/oc-rssfetcher-plugin
```

RSS &amp; Atom feeds
--------------------

[](#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

Components
----------

[](#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.

### Items

[](#items)

Shows a list of most recent RSS items limited on the maximum number of items provided by you.

An example of implementation code in your CMS page:

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

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

```

### PaginatableItems

[](#paginatableitems)

Shows a list of most recent RSS items with an additional paginator element.

An example of implementation code in your CMS page:

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

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

```

### Sources

[](#sources)

Shows a list of sources.

An example of implementation code in your CMS page:

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

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

```

Events
------

[](#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`

Use them like this:

```
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
-----------------

[](#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`.

Cronjob
-------

[](#cronjob)

There are many ways to configure a cronjob. Here's a basic example of cronjob configuration line:

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

```

The above line takes care of fetching all sources every 5 minutes.

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.

Execute from code
-----------------

[](#execute-from-code)

In your plugin code you can also use the following code to execute the Artisan command:

```
