DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: Yet Another Feed Importer

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Dmitry Dulepov
Changed:2009-04-21T10:25:17
Author:Netcreators BV
Email:extensions@netcreators.com
Info 3:
Info 4:

EXT: Yet Another Feed Importer

Extension Key: yafi

Copyright 2007-2009, Netcreators BV, <extensions@netcreators.com>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: My Extension 1

Introduction 1

What does it do? 1

Screenshots 1

Users manual 1

FAQ 1

Adminstration 1

FAQ 2

Configuration 2

FAQ 2

Reference 2

Tutorial 2

Known problems 2

To-Do list 2

Changelog 2

Introduction

What does it do?

This extension imports RSS and ATOM news feeds to the TYPO3. By default it comes with flexible tt_news importer. Other importers can be easily created by programmers by implementing the PHP interface class from this extension.

Feeds are easily configured as records in the Backend (see screenshot). One feed can be imported to any number of places using various importers.

Command line script is used to import feeds using cron job. Alternatively a silent Frontend plugin can be used to import feeds using web-based cron job.

This extension is created as a part of Netcreators work. Netcreators is a TYPO3 company from the Netherlands. You can find the web site at http://netcreators.com/ .

The extension uses SimplePie script to parse feeds. SimplePie is available at http://www.simplepie.org/

Warning about this manual: this manual provides minimal information at the moment. It will be expanded later if necessary.

This extension was created by Dmitry Dulepov for Netcreators BV.

Screenshots

Here is a screenshot of the feed record (imported closed):

img-1

Another screenshot shows the same record with palettes open:

img-2

And here is a tt_news importer configuration:

img-3

News can be imported as regular articles or external URLs.

Adminstration

This section describes how to manage feed importer.

Creating feed records

You can create feed records on any page. To create a record use Web>List module and select “Feed Import” in the list of available records:

img-4 Next fill in the details. “Import interval” accepts human-like language. Examples:

  • +1 day
  • +3 hours
  • +1 hour 40 minutes 10 seconds
  • +1 year 3 months
  • midnight
  • sunrise

The plus sign is mandatory.

Next create at least one feed importer by clicking “Create new feed importer configuration”. Select any available importer type and fill in the details. For the provided tt_news importer you can use the same human-like settings (with minus sign!) in the “Automatically archive...” option. If left empty, no archiving will occure.

Importing feeds

This section describes how to import feeds.

Command line script

Command line script requires _cli_yafi Backend user. Password or settings do not matter, just make the user.

Next you can run the command line script. Navigate to web site directory and type:

typo3/cli_dispatch.phpsh yafi

This will show script options.

If your PHP interpreter is not in the default location, you may need to prepend path to PHP interpreter to the line above.

Frontend plugin

Frontend plugin is a silent script that can import feeds. It has no options at the moment. Everything has to be configured through TypoScript. You can use Constant Editor to set all plugin options. Contant Editor also provides explanations of these options.

Note that using Frontend plugin is not recommended as it was not thoroughly tested.

FAQ

Q: News from some feeds appear with the wrong date and time (usually date and time of import). What's wrong?

A: Many RSS/ATOM feeds either do not provide proper dates. The following is a list of common problems:

  • date is in future
  • date is in the wrong format (for example, Unix time stamp when RFC 822 format is expected)
  • date looks ok at the first glance but not actually valid (for example, ends with “GMT +0100”. There can be only GMT or +0100, not both!)

In this case feed importer uses current date and time as item data and time. You can check that date is invalid using Mozilla Thunderbird or any online feed validator.

Q: Sometimes items are imported twice. Why is that?

A: Feed imported uses two algorithms to prevent duplicate items:

  • Record last import time and skip all times before this time
  • For each item record its id (as provided by feed) or md5 checksum of the content if id is not present and do not import items with the same id

These steps may fail if feed provider edits the item and it gets another timestamp in the feed or another id. In this case Mozilla Thunderbird will import the same item second time too. There is no way to prevent this problem.

Programmer's guide

This section describes how to create your own importer.

Creating a new feed importer

To create a new feed importer, programmer has to implement tx_yafi_importer interface. Interface can be included to any TYPO3 PHP file in the following way:

require_once(t3lib_extMgm::extPath('yafi', 'interface.tx_yafi_importer.php'));

Methods of the interface are documented in the interface. Please, see there.

Registering new importer

The following ext_localconf.php code registers a new importer:

require_once(t3lib_extMgm::extPath('yafi', 'class.tx_yafi_api.php'));
tx_yafi_api::registerImporter('EXT:yafi/importers/class.tx_yafi_ttnews_importer.php:tx_yafi_ttnews_importer');

Known problems

No known problems.

Changelog

Refer to the ChangeLog file in the extension directory.

img-5 EXT: Yet Another Feed Importer - 5