« git.overlays.gentoo.org/git.gentoo.org (gitolite) extra optionsMigrating from gitosis to gitolite »

Bugzilla feeds

Permalink 12/13/10 14:13, by Christian Ruppert, Categories: Linux, Gentoo, English , Tags: , , , , , , , ,

If you ever wanted to use Bugzilla's feed to get each bug since your last query? Read on...


Bugzilla has two interesting variables, "chfieldfrom" and "chfieldto" which can be a time value. It can be a timestamp like from: date -u "+%Y-%m-%d+%H:%M".

But a small script is needed to use them properly. Some feed reader may have own variables which you can use directly in the source URL.

Code:

#!/bin/sh
 
DATE_FILE=$HOME/.bugfeed
FEED_URL='https://bugs.gentoo.org/buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=DATE&chfieldto=Now&query_format=advanced&remaction=&title=Bug%20List&ctype=atom'
 
if [ -f "${DATE_FILE}" ]; then
  LAST_DATE=$(< $DATE_FILE)
else
  LAST_DATE="-1d"
fi
 
FEED_URL="$(echo "$FEED_URL"|sed "s/DATE/${LAST_DATE}/")"
#echo $FEED_URL
 
DATE_NOW=$(date -u "+%Y-%m-%d+%H:%M")
curl "$FEED_URL"
 
echo $DATE_NOW > $DATE_FILE

The script stores the date value of your last query and uses it later as "chfieldfrom", "chfieldto" is always "now".

To use it in e.g. Liferea:

Liferea->Subscriptions->New Subscription->Advanced, select Command and choose your script. That's it.

Attachments:

Trackback address for this post

Trackback URL (right click and copy shortcut/link location)

2 comments

Comment from: foo [Visitor]
fooWhy not just use SD?

http://syncwith.us/sd/
12/14/10 @ 07:03
Comment from: Maciej Mrozowski [Visitor]
Maciej MrozowskiBecause it's Bugzilla that we use in Gentoo.
12/15/10 @ 21:25

This post has 230 feedbacks awaiting moderation...

May 2012
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Search

XML Feeds

powered by b2evolution free blog software

©2012 by Christian Ruppert

Contact | Help | b2evolution skin by Asevo | blog software | top hosting