| « git.overlays.gentoo.org/git.gentoo.org (gitolite) extra options | Migrating from gitosis to gitolite » |
Bugzilla feeds
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.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
2 comments
This post has 125 feedbacks awaiting moderation...