Skip to main content

Turn external feed entries into content items

Project description

Feedfeeder

Feedfeeder has just a few things it needs to do:

  • Read in a few ATOM feeds (not too many).

  • Create FeedFeederItems out of the entries pulled from the ATOM feeds. Any feed items that contain enclosures will have the enclosures pulled down and added as File items to the feed item.

  • This means figuring out which items are new, which also means having a good ID generating mechanism.

Wait, no existing product?

There’s a whole slew of RSS/ATOM reading products for zope and plone. None of them seemed to be a good fit. There was only one product that actually stored the entries in the zope database, but that was aimed at a lot of users individually adding a lot of feeds, so it needed either a separate ZEO process (old version) or a standalone mysql database (new version).

All the other products didn’t store the entries in the database, were old/unmaintained/etc.

In a sense, we’re using an existing product as we use Mark Pilgrim’s excellent feedparser (http://feedparser.org) that’ll do the actual ATOM reading for us.

Product name

The product feeds the content of ATOM feeds to plone as document/file content types. So “feedfeeder” sort of suggested itself as a funny name. Fun is important :-)

Product structure

I’m using archgenxml to generate the boiler plate stuff. There’s a ‘generate.sh’ shell script that’ll call archgenxml for you. Nothing fancy.

The feedfeeder’s content types are:
  • folder.FeedfeederFolder

  • item.FeedFeederItem

How it works

A feedfeeder is a folder which contains all the previously-added feed entries as documents or files. It has a ‘feeds’ attribute that contains a list of feeds to read.

Feedparser is called periodically (through a cron job?) to parse the feeds. The UID of the items in the feed are converted to a suitable filename (md5 hex hash of the atom id of the entry), that way you can detect whether there are new items.

New items are turned into feed items.

Scheduled updates for feed folders

Zope can be configured to periodically trigger a url call. In zope.conf you can use the <clock-server> directive to define a schedule and url with the following data:

<clock-server>
   method /path_to_feedfolder/update_feed_items
   period 3600 # seconds
   user admin
   password 123
   host localhost:8080
</clock-server>

Dependencies

  • Works with Plone 2.5, 3.0 or 3.1.

Tests

The look-here-first test is the doctest at ‘doc/feedfeeder-integration.txt’.

Testing is best done with zope’s zopectl.

bin/zopectl test -s Products.feedfeeder'.

History of feedfeeder

1.0rc4 (2009-06-18)

  • When both the updated and published date of an item is not known, take today as the date when first adding it. When updating, do not change the original item. Fixes http://plone.org/products/feedfeeder/issues/21 [maurits]

  • Read tags/categories/keywords of feed items and store them on the created content item. No Archetypes field, just a simple getter and setter called feed_tags. Idea: Robin Harms Oredsson. [maurits]

  • DateTime.SyntaxError is thrown with some very common US Daylight Saving zones, such as EDT. We now wrap the DateTime parsing of feeds, to try to recognise those zones before politely giving up, using maurits’ fix, below. [russf]

  • Catch DateTime.SyntaxError when parsing the updated and published dates of an entry and continue with the next entry. Fixes http://plone.org/products/feedfeeder/issues/18 [maurits]

  • Avoid swallowing too much exceptions when applying our GenericSetup profile. Fixes http://plone.org/products/feedfeeder/issues/19 [maurits]

1.0rc3 (2008-10-04)

  • Moved profile definition from python to GenericSetup. Profile is now not ‘profile-feedfeeder:default’ but ‘profile-Products.feedfeeder:default’. [maurits]

  • In the Extensions/ dir: removed Install.py and renamed AppInstall.py to install.py. [maurits]

  • Made feed item updated date available for Collections/Smart Folders. [maurits]

  • Extensions/AppInstall.py: first try installing our own profile in the Plone 3 way and when that fails try the Plone 2.5 way. [maurits]

  • Removed own feedparser.py. Instead added an install_requires dependency on FeedParser in setup.py. [maurits]

  • Moved fix for feeds starting with ‘feed:’ instead of ‘http:’ from feedparser.py to utilities.py, so we use an unchanged feedparser.py again. [maurits]

1.0 rc 2 (2008-07-23)

  • Re-release of rc1: rc1 was missing all .txt files, making install impossible as setup.py reads version.txt. [reinout]

1.0 rc 1 (2008-07-15)

1.0 beta 4 (2008-05-20)

  • Eggification: you can now install it as the Products.feedfeeder egg. [maurits]

1.0 beta 3 (2008-05-13)

  • In the tests, use plone_workflow explicitly, so it is easier to test on both Plone 2.5 and 3.0. [maurits]

  • Make update_feed_items available in the object_buttons for Plone 3, using new small @@is_feedcontainer as condition. [maurits]

  • Avoid deprecation warnings for events and interfaces. [maurits]

  • Remove semicolon in page template that broke in Plone 3. [maurits]

  • Fix imports so they work in Plone 3 as well, without deprecation warnings. [derstappenit]

1.0 beta 2 (2008-01-02)

  • History begins.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Products.feedfeeder-1.0rc4.tar.gz (39.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page