blueways / bw-cache-uri
TYPO3 extension to parse remote content and save to tt_content element
Installs: 396
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:typo3-cms-extension
Requires
- symfony/css-selector: ^4.3
- symfony/dom-crawler: ^4.3
- symfony/http-client: ^4.3
- typo3/cms-core: ^9.5 || ^10.0 || ^11.0
- typo3/cms-scheduler: ^9.5 || ^10.0 || ^11.0
Requires (Dev)
- bk2k/bootstrap-package: 12.0.x-dev
- clue/phar-composer: ^1.0
- typo3/cms-base-distribution: ^11.0
This package is auto-updated.
Last update: 2024-12-19 18:02:08 UTC
README
This TYPO3 extension extends the tt_content element HTML
for the functionality of loading and postprocessing remote content.
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
- Install via composer
composer require blueways/bw-cache-uri
- Include TypoScript template
Usage
Just create a new HTML-Content Element and add any URL in the parsing options. After saving, the remote content is fetched, processed and saved.
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.