import MySQLdb, config, urllib, cgi, datetime
sql = MySQLdb.connect(host="localhost", 
                            user=config.username, 
                            passwd=config.passwd,
                            db=config.test_db)
sql.query("SELECT `site`,`section`,`url`,`id` FROM `feedurls`")
db_feed_query=sql.store_result()
rss_urls=db_feed_query.fetch_row(0)
table_name = "stories"
date_from = datetime.strptime(input("start date inc. in form 'dd-mm-yyyy'"),"%d-%m-%Y")
date_to = datetime.strptime(input("end date inc. in form 'dd-mm-yyyy'"),"%d-%m-%Y")

@@ -39,16 +39,46 @@
 atetime%0A
+from datetime import datetime%0A
 sql = My
@@ -566,28 +566,158 @@
  'dd-mm-yyyy'%22),%22%25d-%25m-%25Y%22)%0A
+for rss_urls_data in rss_urls:%0A    feed_id=rss_url_data%5B3%5D%0A    i = start_date %0A    while i %3C= end_date:%0A        print end_dates%0A %0A

fix import bug not getting proper datetime opj