Anpassungen für das Hosting bei Djangoeurope und damit verbundenen Versionen Django 1.8 und Python 2.7
This commit is contained in:
committed by
Christian Berg
parent
cb4b15b3c6
commit
37d3cb78c1
21
src/aggregator/management/commands/update-feeds.py
Normal file
21
src/aggregator/management/commands/update-feeds.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Update feeds for Django community page. Requires Mark Pilgrim's excellent
|
||||
Universal Feed Parser (http://feedparser.org)
|
||||
"""
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from aggregator.models import Feed
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Updates all RSS Feeds"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
verbose = int(options['verbosity']) > 0
|
||||
for feed in Feed.objects.filter(is_functional=True):
|
||||
if verbose:
|
||||
print
|
||||
print "%s - URL: %s" % (feed.title, feed.feed_url)
|
||||
print '=' * 80
|
||||
feed.parse()
|
||||
Reference in New Issue
Block a user