add motd generator script
[freebsd-maintainer-scripts/.git] / getprs
1 #!/bin/sh
2
3 : {USER:="sbz"}
4
5 SCRIPT=${0##*/}
6 SCRIPT_VERSION="1.0"
7
8 PR_SUMMARY_URL="http://www.freebsd.org/cgi/query-pr-summary.cgi?responsible=${USER}"
9
10 format_line() {
11         sed -n "s#^<tr class='o'><td>o</td><td>\([^<]*\)</td><td><a href='/cgi/query-pr.cgi?pr=[^']*'>\([^<]*\)</a></td><td>[^<]*</td><td>\([^<]*\)</td></tr>#\1 | \2  | \3#p"
12 }
13
14 fetch_prs() {
15         HTTP_USER_AGENT="${SCRIPT}/${SCRIPT_VERSION}" fetch -q -o - ${PR_SUMMARY_URL} 2>&1 | format_line
16 }
17
18 fetch_prs