Name
p4rss.py - generate RSS feed from
p4 changes -m 10
.
Synopsis
python p4rss.py > /path/to/rssfile
Description
p4rss.py converts usual output from p4 changes e.g.
Change 10 on 2003/02/26 by hjh@p4rss 'Doc on RSS 0.91 vs 1.0, and cos'
Change 9 on 2003/02/26 by hjh@p4rss 'Add a bit more doc. '
Change 8 on 2003/02/26 by hjh@p4rss 'Documentation and cosmetic chan'
...
to RSS 0.91 format see sample.p4rss.xml.
Run it inside a cron job to generate the RSS periodically.
Because p4rss.py uses vanilla p4, user can modify its behaviour with
usual P4 environment variables.
Bugs
p4rss.py has many limitations:
- because 'p4 changes' limits description of changelist to 31 characters,
so does p4rss.py. One way to bypass this limit is to do a join with 'p4 changes'
and 'p4 describe -s'. Maybe in the future.
- no way to limit the change list to specific depot/branch.
- supports only RSS 0.91 and not other versions of RSS.
- need to escape HTML entities in <description>
- p4 changes returns following data fields
- status: ignored
- client: ignored
- user: ignored
- code: ignored
- time: ignored
- change: displayed as <title> element
- desc: displayed as <description> element
User and time fields are useful information and need to be displayed.
Maybe more extensible RSS 1.0+ should be used instead of really simple 0.91?
- <link> element is set to http://127.0.0.1 for now i.e. it is not
really meaningful.
One solution would be make p4rss configurable and let users
choose either p4db or p4web or some other web frontends.
However p4web's URL is a pretty complicated (need to find some doc)
- currently number of items displayed is hardcoded to 10.
- no support for caching and other advanced features.
Todo
- study web interfaces like p4db, p4web or PyDS
- trim this doc comment as it's even longer than the code!
Download
python script: p4rss.zip
and sample RSS: sample.p4rss.xml
Copyright 2003 Jay Han
You are free to use it as long as you do not blame me for anything.