Skip to main content

A tail-f-like utility for feeds

Project description

Feedstail is a tail-f-like utility for feeds. It monitor a feed and emits new entries. Feedstail aim to be simple, hackable and compatible with rsstail its C brother.

License

Feedstail is released under the terms of the GNU General Public License v3 or later.

Get started

Use pip to install feedstail the easy way:

$ pip install feedstail

Or retrieve the project with git and install it:

$ git clone git://gitorious.org/feedstail/feedstail.git
$ cd feedstail
$ python setup.py install

Then, launch feedstail with the identi.ca feeds to test it:

$ feedstail -u http://identi.ca/api/statuses/public_timeline.atom

Examples

By default, feedstail will checkout the feeds every 15 minutes. If you want to customize this interval you can use the i option. The following example will retrieve feeds every 5 seconds:

$ feedstail -u http://identi.ca/api/statuses/public_timeline.atom -i 5

The default output format may not be ok for you. You can specify your own format using the f option. The given fields must be an available property of the feed entries. The following example will output the published date, the title and the link:

$ feedstail -u http://identi.ca/api/statuses/public_timeline.atom -f "{published}: {title} - {link}"

This last example use the string formatting syntax appeared in the 2.6 version of Python. However, feedstail aim to be 2.5 compatible so you can use the old string formatting syntax:

$ feedstail -u http://identi.ca/api/statuses/public_timeline.atom -f "%(published)s: %(title)s - %(link)s"

Feedstail compares the id element to find new entries. You can choose another element of comparison with the k option. The following example says to feedstail to use the title to find new entries:

$ feedstail -u http://identi.ca/api/statuses/public_timeline.atom -i 2 -k title

As feedstail is built above feedparser, the available values of format fields and keys can be found in the documentation of the library.

Importing to other python project

Feedstail could be imported to another python project with:

from feedstail import feedGenerator
from feedstail.config import Config
Options :
  • key : The comparaison key. By default: id

  • reverse : Boolean value for reversing the entries of the feed. By default: False

  • number : At the first time, show x entries. By default, it is None and shows all the received entries.

  • ignore_key_error : Boolean value for ignore keys errors. By default: False

  • no_endl : Boolean value for ignoring end lines. By default: False

  • url : The url. By default: None

  • format : The format of entries.

Options not present :
  • interval : The interval time for checking the feed.

  • one shot : Get once the feed.

The feedGenerator take an instance of Config as parameters and return a generator. This generator will return an array of entries (could be an empty array) with the defined format.

Example:

from feedstail import feedGenerator
from feedstail.config import Config

feed = feedGenerator(Config(url="http://identi.ca/api/statuses/public_timeline.atom", format=u'{title} - {link}'))
print '\n'.join(feed.next())

Contribute !

Don’t forget to mark your commits by one of the following flag:

  • [enh]: Your commit add a notable enhancement, a new feature for instance

  • [fix]: Your commit is a bugfix

  • [doc]: Your commit improve the documentation

  • [mod]: Your commit bring general changes, matching neither of the above, like refactoring

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

feedstail-0.5.tar.gz (17.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

feedstail-0.5-py2.py3-none-any.whl (24.8 kB view details)

Uploaded Python 2Python 3

feedstail-0.5-py2.7.egg (22.0 kB view details)

Uploaded Egg

File details

Details for the file feedstail-0.5.tar.gz.

File metadata

  • Download URL: feedstail-0.5.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for feedstail-0.5.tar.gz
Algorithm Hash digest
SHA256 fa243cee956dd1000625567c92d16de867f7dbc55df0579e21641b5034952e06
MD5 adc3e2d46b33456c4ce495066417135d
BLAKE2b-256 fbcd00adb9e5c500f3a40c13b9c3d8c7de624283c210a46d3ae04e751d784b12

See more details on using hashes here.

File details

Details for the file feedstail-0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for feedstail-0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dd205b85bd25695207a2ee1dfd3d7efb1ecafa069c812f90fc2efd7cc51a8fb4
MD5 9997051b63562fb8263ded609df89217
BLAKE2b-256 d5baff20800b751882956e095bbff40ba6a290e333db0511756e2e1fe1c82393

See more details on using hashes here.

File details

Details for the file feedstail-0.5-py2.7.egg.

File metadata

  • Download URL: feedstail-0.5-py2.7.egg
  • Upload date:
  • Size: 22.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for feedstail-0.5-py2.7.egg
Algorithm Hash digest
SHA256 dc40fa7e9bfdbcebc9d082dd8c49f0938b3ebb90722d59e759864fe9ccb67eaa
MD5 d782748bbbbccff0ce825e60ecb8823b
BLAKE2b-256 d967f9f43c0215b727116ed67ecfeb9c1b1414e6187411e8870acf26accf2693

See more details on using hashes here.

Supported by

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