from django.http import HttpResponse
import feedparser
from ubermicro.shows.models import show
def show_page(request):
"""this is where we take what we need form the rss feeds in the
data base"""
query = show.objects.filter(show_feed__contains="http://")
podcast = feedparser.parse(query)
#show_about = podcast.feed.description
show_latest_title = podcast.entries[0].title
#show_latest = podcast.entries[0].description
return HttpResponse(show_latest_title)
this code is what I think its doing is that I am grabing the rss url
then using feedparser (http://www.feedparser.org) to get rss element
such as <description> and such but every time I try to do this I get
this error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
site-packages/django/core/handlers/base.py" in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "/Users/sebey/Sites/ubermicro/../ubermicro/shows/views.py" in
show_page
10. show_latest_title = podcast.entries[0].title
IndexError at /shows/
list index out of range
I am to django programing web dev etc. but I guess that the query I am
useing is not correct so I what should I do thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---