コード例 #1
0
    def get(self):
        IP = '184.74.167.234'
        ba = BnterOAuth(IP)
        template_values = {'user_name': 'laurenleto', 'hide_welcome': False}

        path = os.path.join(os.path.dirname(__file__), '../html/index.html')
        self.response.out.write(template.render(path, template_values))
コード例 #2
0
    def get(self):
        IP = self.request.remote_addr
        ba = BnterOAuth(IP)
        token = ba.getToken()
        if not token:
            self.redirect('/get_oauth')

        template_values = {
            'user_name': self.request.get('user_name'),
            'hide_welcome': self.request.get('hide_welcome')
        }

        path = os.path.join(os.path.dirname(__file__), '../html/index.html')
        self.response.out.write(template.render(path, template_values))
コード例 #3
0
    def get(self):
        user_name = self.request.get('user_name')
        if memcache.get(user_name + 'updated'):
            self.response.out.write(json.dumps({"page": 1, "pageCount": 1}))
            return

        ba = BnterOAuth(self.request.remote_addr)
        edgeManager = EdgeManager(ba.getToken())
        page = self.request.get('page')
        info = edgeManager.updateEdgesForUser(user_name.lower(), page)
        if info['page'] == info['pageCount']:
            logging.info("Update friends for %s" % user_name)
            memcache.set(user_name + 'updated', 1, 6000)
        self.response.out.write(
            json.dumps({
                "page": info['page'],
                "pageCount": info['pageCount']
            }))
コード例 #4
0
 def get(self):
     IP = self.request.remote_addr
     ba = BnterOAuth(IP)
     ba.flush()
     self.redirect('/')
コード例 #5
0
 def get(self):
     IP = self.request.remote_addr
     oauth_token = self.request.get('oauth_token')
     ba = BnterOAuth(IP)
     ba.setVerifier(oauth_token)
     self.redirect('/')
コード例 #6
0
 def get(self):
     IP = self.request.remote_addr
     ba = BnterOAuth(IP)
     path = ba.getOAuthClient()
     self.redirect(path)
コード例 #7
0
 def get(self):
     ba = BnterOAuth(self.request.remote_addr)
     edgeManager = EdgeManager(ba.getToken())
     user_name = self.request.get('user_name')
     edges = edgeManager.getEdgesForUser(user_name.lower())
     self.response.out.write(json.dumps(edges))