blueways/bw-cache-uri

TYPO3 extension to parse remote content and save to tt_content element

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Type:typo3-cms-extension

v1.1.2 2019-10-08 13:18 UTC

This package is auto-updated.

Last update: 2020-08-08 15:16:17 UTC


README

This extensions extends the TYPO3 content element tt_content with CType 'html' for the functionality of loading remote content.

Example Image

Features

  • Load and save remote content from URL
  • Filter saved DOM with CSS selectors
  • Manipulate the content with custom post-processors (e.g. stripe tags, add wrap,..)
  • Options for processors via TypoScript
  • Scheduler task to refresh content

Install

See official packages site for requirements. You can use the bitbucket issue tracker to report errors or feature requests.

composer require blueways/bw-cache-uri

Activate the extension via Extension Manager and add the static TypoScript template

Usage

Just create a new HTML-Content Element and add any URL in the parsing options.

Scheduler

The DOM Downloader task will refresh the bodytext of all tt_content elements that have a parsing uri set.

Post Processor

After receiving the remote content, custom post processors can be applied to transform the content, e.g. to wrap or remove text. To register a new processor, add the following TypoScript:

plugin.tx_bwcacheuri.settings.postProcessors {
    Vendor\YourExt\Processor\MyFancyProcessor {
        label = Name in select box
        options {
            custom_setting = 2,4
            allowed_tags = <div>
        }
    }
}

Your processor class must implement the PostProcessorInterface:

<?php
namespace Vendor\YourExt\Processor;

class MyFancyProcessor implements \Blueways\BwCacheUri\Processor\PostProcessorInterface
{
    public function process($dom, $options)
    {
        return strip_tags($dom, $options['allowed_tags']);
    }
}

DDEV cron job

See ddev-contrib to see how to make the scheduler run locally.

Examples

Use Filter to get current weather

Weather example

Get current Time

Time example