예제 #1
0
파일: main.py 프로젝트: Quasimo/Vealous
 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))
예제 #2
0
파일: main.py 프로젝트: lepture/Vealous
 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))
예제 #3
0
파일: main.py 프로젝트: wangjun/Vealous
 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))