def feed(): sets = eol.get_photosets() feed_items = [] for s in sets: name = str(s['num']) + " New Images From the ISS" link = "http://eol-browser.herokuapp.com/updates/" + s['id'] desc = str( s['num'] ) + " new images added to the EOL database, scrapped on " + s['datestr'] date = datetime.datetime.strptime(s['id'], "%Y%m%d") item = PyRSS2Gen.RSSItem(name, link, desc, "EOL Browser", None, None, None, PyRSS2Gen.Guid(link), date) feed_items.append(item) rss = PyRSS2Gen.RSS2(title="Recent Images From the ISS", link="http://eol-browser.herokuapp.com/", description="The latest images of Earth from space", lastBuildDate=datetime.datetime.now(), items=feed_items) return Response( rss.to_xml(), mimetype= 'application/rss+xml, application/rdf+xml, application/atom+xml, application/xml, text/xml' )
def about(): sets = eol.get_photosets() n = eol.count_photos() return render_template('about.html', sitename=GLOBALS["sitename"] , title="About This Site" , links=[{"title": "All Images", "url": "/"}] , photosets=sets , nphotos=n)
def about(): sets = eol.get_photosets() n = eol.count_photos() return render_template('about.html', sitename=GLOBALS["sitename"], title="About This Site", links=[{ "title": "All Images", "url": "/" }], photosets=sets, nphotos=n)
def feed(): sets = eol.get_photosets() feed_items = [] for s in sets: name = str(s['num']) + " New Images From the ISS" link = "http://eol-browser.herokuapp.com/updates/"+s['id'] desc = str(s['num']) + " new images added to the EOL database, scrapped on " + s['datestr'] date = datetime.datetime.strptime(s['id'], "%Y%m%d") item = PyRSS2Gen.RSSItem(name, link, desc, "EOL Browser", None, None, None, PyRSS2Gen.Guid(link), date) feed_items.append(item) rss = PyRSS2Gen.RSS2( title = "Recent Images From the ISS", link = "http://eol-browser.herokuapp.com/", description = "The latest images of Earth from space", lastBuildDate = datetime.datetime.now(), items = feed_items) return Response(rss.to_xml(), mimetype='application/rss+xml, application/rdf+xml, application/atom+xml, application/xml, text/xml')