summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-10-27 13:27:32 +0100
committerStefan Ritter <xeno@thehappy.de>2009-10-27 13:27:32 +0100
commitc5f82a156b07d02831096773c6f4a7be7d462caa (patch)
treeea1b8c8b10d163df28897fbe879fbe71036376ef
First commit
-rwxr-xr-xrfpquery.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/rfpquery.py b/rfpquery.py
new file mode 100755
index 0000000..79ded94
--- /dev/null
+++ b/rfpquery.py
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+
+import urllib2, sys, re
+
+if len(sys.argv) < 2:
+ print 'Syntax:', sys.argv[0], '[max_days_old]'
+ sys.exit()
+
+try:
+ max_days_old = int(sys.argv[1])
+except:
+ print 'Not an integer!'
+ sys.exit()
+
+
+reports = []
+item = []
+
+rfpurl = urllib2.urlopen('http://www.debian.org/devel/wnpp/requested')
+
+for line in rfpurl:
+ if re.findall('bugs\.debian\.org', line) or re.match('requested(.*)ago', line):
+ # First line
+ if re.match('^.ul.(.*),', line) or re.match ('^(.*)li.(.*),', line):
+ # Link
+ link = re.sub('<ul>', '', line)
+ link = re.sub('<li><a href="', '', link).strip()[:29]
+ item.append(link)
+
+ # Name
+ name = re.sub('<ul>', '', line).strip()
+ name = name[44:]
+ name = name.split(':', 1)[0]
+ item.append(name)
+
+ # Second line
+ if re.match('^requested(.*)', line):
+ days = re.sub('requested ', '', line)
+ days = re.sub(' days ago.', '', days).strip()
+ item.append(days)
+
+ if len(item) == 3:
+ reports.append(item)
+ item = []
+
+for entry in reports:
+ if int(entry[2]) <= max_days_old:
+ print entry[1] + ': ' + entry[2] + ' days old (' + entry[0] + ')'