Author: jacob
Date: 2007-06-07 11:49:31 -0500 (Thu, 07 Jun 2007)
New Revision: 5430
Added:
djangoproject.com/django_website/apps/aggregator/bin/mark_defunct_feeds.py
Log:
Added a tool to mark defunct feeds.
Added:
djangoproject.com/django_website/apps/aggregator/bin/mark_defunct_feeds.py
===================================================================
--- djangoproject.com/django_website/apps/aggregator/bin/mark_defunct_feeds.py
(rev 0)
+++ djangoproject.com/django_website/apps/aggregator/bin/mark_defunct_feeds.py
2007-06-07 16:49:31 UTC (rev 5430)
@@ -0,0 +1,14 @@
+"""
+Mark people with 404'ing feeds as defunct.
+"""
+
+for f in Feed.objects.all():
+ try:
+ r = urllib2.urlopen(f.feed_url)
+ except urllib2.HTTPError, e:
+ if e.code == 404 or e.code == 500:
+ print "%s on %s; marking defunct" % f
+ f.is_defunct = True
+ f.save()
+ else:
+ raise
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---