def get(self): items = db.GqlQuery("SELECT * FROM NewsItem ORDER BY date DESC LIMIT 25") context = add_user_to_context({'news':items }) #context = add_user_to_context(context) self.response.out.write( template.render(tmpl('templates/news2.html'), context ))
def get(self): url = cgi.escape(self.request.get('url')) if not url: self.response.out.write('Please pass a feed-url as a get-param "url".') try: result = urlfetch.fetch(url) except: self.response.out.write('Invalid or non-existing URL.') if result.status_code == 200: rssfeed = feedparser.parse(result.content) self.response.out.write( template.render(tmpl('templates/admin/feedpreview.html'), {'feed': rssfeed} )) else: self.response.out.write('error')
def get(self): url = settings.YAHOO_PIPE % 'rss' result = urlfetch.fetch(url) if result.status_code == 200: feed = feedparser.parse(result.content) for i in feed.entries: item = NewsItem(key_name=i.guid) item.url = i.link item.title = i.title item.text = i.summary item.date = datetime.datetime(*i.date_parsed[:6]) item.orderdate = datetime.datetime(*i.date_parsed[:6]) item.put() items = db.GqlQuery("SELECT * FROM NewsItem ORDER BY orderdate DESC LIMIT 100") context = {'news':items } #context = add_user_to_context(context) self.response.out.write( template.render(tmpl('templates/news2.html'), context )) else: self.response.out.write('err')
def get(self): v = Videos.all()[0] context = add_user_to_context({ 'users': v.users, 'searches': v.searches }) self.response.out.write( template.render(tmpl('templates/video.html'), context ))
def get(self): context = { } self.response.out.write( template.render(tmpl('templates/map.html'), context ))
def get(self): t = Twitter.all()[0] context = add_user_to_context({'keywords': t.keywords }) self.response.out.write( template.render(tmpl('templates/twitter.html'), context ))
def get(self): context = { } #context = add_user_to_context(context) self.response.out.write( template.render(tmpl('templates/twitter.html'), context ))