def get(self): rdic = {} source = self.request.get('from', None) message = '' if source: session = Session(self) message = session.get('message','') session.delete('message') rdic['message'] = message comments = memcache.get('disqus$comments') ua = self.request.headers.get('User-Agent', 'bot') path = get_path(ua, 'dashboard.html') rdic['notes'] = dbs.Note.getten() if comments is not None: rdic['comments'] = comments return self.response.out.write(render(path,rdic)) disqus_key = dbs.Vigo.get('disqus_key') disqus_forumid = dbs.Vigo.get('disqus_forumid') mydisqus = Disqus(disqus_key) mydisqus.get_forum_posts_rpc(disqus_forumid) result = mydisqus.get_forum_posts_result() comments = mydisqus.parse_data(result) memcache.set('god$comments', comments, 10800) # 3 hours rdic['comments'] = comments return self.response.out.write(render(path,rdic))
def get(self): rdic = {} source = self.request.get('from', None) message = '' if source: message = self.session.get('message','') self.session.delete('message') rdic['message'] = message comments = memcache.get('disqus$comments') path = get_path(self.request, 'dashboard.html') if comments is not None: rdic['comments'] = comments return self.response.out.write(render(path,rdic)) disqus_key = config.disqus_userkey disqus_forumid = config.disqus_forumid mydisqus = Disqus(disqus_key) mydisqus.get_forum_posts_rpc(disqus_forumid) result = mydisqus.get_forum_posts_result() comments = mydisqus.parse_data(result) memcache.set('disqus$comments', comments, 10800) # 3 hours rdic['comments'] = comments return self.response.out.write(render(path,rdic))
def get(self): rdic = {} source = self.request.get("from", None) message = "" if source: message = self.session.get("message", "") self.session.delete("message") rdic["message"] = message comments = memcache.get("disqus$comments") path = get_path(self.request, "dashboard.html") if comments is not None: rdic["comments"] = comments return self.response.out.write(render(path, rdic)) disqus_key = config.disqus_userkey disqus_forumid = config.disqus_forumid mydisqus = Disqus(disqus_key) mydisqus.get_forum_posts_rpc(disqus_forumid) result = mydisqus.get_forum_posts_result() comments = mydisqus.parse_data(result) memcache.set("disqus$comments", comments, 10800) # 3 hours rdic["comments"] = comments return self.response.out.write(render(path, rdic))