Home > feed2dent

feed2dent

Feed2dent is a project mainly written in Python, based on the View license.

a feed to identica script for spewing atom/rss feeds to identica [No longer maintained]

feed2dent: A command line (rss/atom) to identi.ca post utility.

Description

feed2dent is an (RSS/ATOM) feed to identi.ca agent. It pulls feeds from a feed url, and posts the result to identi.ca. The link to the original feed article is converted to a 'short url', and the title is chopped at 140 characters.

Dependencies

  • python
  • python-lxml
  • python-feedparser
  • jinja2

if python-version < 2.6:

  • python-simplejson

Note: python-2.6 includes the 'json' module, which works fine. You only need simplejson if you are using python-2.5 or earlier.

Installation

  1. Install dependencies easy_install lxml easy_install feedparser easy_install jinja2

    if python-2.5 or earlier

     easy_install simplejson
  2. Checkout the code
  3. Copy config.ini.default to config.ini, and edit as needed. Notably, edit the 'user' and 'passwd' stanzas in the [identica] section.
  4. Ensure the directory is writable by the user your run it as (so that the dat file can be saved).

Template Syntax

The config.ini file can use templates for posting to identi.ca. The template string convention is as follows.

[feeds]
somename: http://some/feed/url
otherfeed: http://other/feed/url

[templates]
default: {{ url | shortenurl }} {{ title }}
somename: {{ url | shortenurl }} {{ title }}

If a template name matches a feed name, that templat gets used. If there are no matches, then the default template is used.

Right now, only url and title variables are exported to the template system. shortenurl is a filter, that accepts a url as input, and performs a tighturl shortening upon it. If you want a longer url, then leave that off.

This can be useful if, for instance, you want your posts from one rss to go to a certain identi.ca group. In such a case, your template could look like:

!groupname {{ url | shortenurl }} {{ title }}

Example Usage

The following fetches all feeds, saves state, and posts any new items to identica.

./feed2dent feed 

The following runs with debug info output, fetches all feeds, saves state, but does not post to identica. Useful for debugging issues.

./feed2dent -vv feed -f

The following posts a simple string to identica. It does not parse feeds. Useful for sending a quick identica post from the command line.

./feed2dent dent just a test

The follwing does nothing but output some logging.

./feed2dent -vv dent -f this does nothing :D

The following simply outputs the help for the dent command.

./feed2dent help dent

License

See LICENSE file.

Previous:palava-jpa