Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a tool to mark defunct feeds.

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@5430 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cd7f714ea2045fa8db4bd01846785d83ab061755 1 parent 0a7f424
jacob authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 django_website/apps/aggregator/bin/mark_defunct_feeds.py
View
14 django_website/apps/aggregator/bin/mark_defunct_feeds.py
@@ -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

0 comments on commit cd7f714

Please sign in to comment.
Something went wrong with that request. Please try again.