Hello,
This is my first python script, so I could use a little bit of help here. :)
I'm using the 'Universal Feed Parser' (http://feedparser.org/), and I have a list of feed URLs in a database which I would like to pull out and go through each of them. I am also using the ADOdb database module, as I am familier with it (in PHP .. however, it is pretty similar ..)
Here's what I have so far, the only thing this does is pulls the URLs out of the database, and prints them:
#!/usr/bin/env python
import MySQLdb
import adodb
import feedparser
conn = adodb.NewADOConnection('mysql')
conn.Connect('localhost','root','dadada','db');
cursor = conn.Execute('SELECT feed_url FROM feed_urls')
while not cursor.EOF:
for row in cursor.fields:
print row
cursor.MoveNext()
cursor.Close()
conn.Close()
As I said, this above code works perfectly. However, I want to take that output, and put it in something like this:
while not cursor.EOF:
for row in cursor.fields:
d = feedparser.parse(FEED_URL_HERE) <-- This is where I need the output of the db results to appear
So, basically .. the above code is calling a function from the 'Universal Feed Parser' module, which takes in a url .. basically, when it executes, I want python to read it like this:
d = feedparser.parse('http://www.url.com/to/rss.feed')
I know it has got to be something simple. I'd definitely appreciate some help on this. Thank you very much :)