コード例 #1
0
 def request_access_token_info(self, at):
     r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'), access_token=at)
     current = int(time.time())
     expires = r.expire_in + current
     remind_in = r.get('remind_in', None)
     if remind_in:
         rtime = int(remind_in) + current
         if rtime<expires:
             expires = rtime
     return weibo.JsonDict(expires=expires, expires_in=expires, uid=r.get('uid', None))
コード例 #2
0
ファイル: initclient.py プロジェクト: stefwoo/sendweibo
	def request_access_token_info(self, at):
                """
                该接口传入参数at为已经授权的access_token,函数将返回该access_token的详细信息,返回Json对象,与APIClient类的request_access_token类似。
                """
		r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'), access_token = at)
		current = int(time.time())
		expires = r.expire_in + current
		remind_in = r.get('remind_in', None)
		if remind_in:
			rtime = int(remind_in) + current
			if rtime < expires:
				expires = rtime
		return weibo.JsonDict(expires=expires, expires_in=expires, uid=r.get('uid', None))
コード例 #3
0
ファイル: initclient.py プロジェクト: cssmlulu/sinaWeibo
	def request_access_token_info(self, at):
		'''
		return access token as a JsonDict: {"access_token":"your-access-token","expires_in":12345678,"uid":1234}, expires_in is represented using standard unix-epoch-time
		'''
		r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'), access_token = at)
		current = int(time.time())
		expires = r.expire_in + current
		remind_in = r.get('remind_in', None)
		if remind_in:
			rtime = int(remind_in) + current
			if rtime < expires:
				expires = rtime
		return weibo.JsonDict(expires=expires, expires_in=expires, uid=r.get('uid', None))
コード例 #4
0
ファイル: initclient.py プロジェクト: qinxuzhen/weibosend
 def request_access_token_info(self, access_token):
     """
     该接口传入参数access_token为已经授权的access_token,函数将返回该access_token的详细信息,返回Json对象,与APIClient类的request_access_token类似。
     """
     r = weibo._http_post("%s%s" % (self.auth_url, "get_token_info"), access_token=access_token)
     # TODO 此处时间rtime,expires比较用处是何?
     current = int(time.time())
     expires = r.expire_in + current
     remind_in = r.get("remind_in", None)
     if remind_in:
         rtime = int(remind_in) + current
         if rtime < expires:
             expires = rtime
     return weibo.JsonDict(expires=expires, expires_in=expires, uid=r.get("uid", None))
コード例 #5
0
ファイル: initclient.py プロジェクト: wyrover/weiboanalyze
 def request_access_token_info(self, access_token):
     """
     该接口传入参数access_token为已经授权的access_token,函数将返回该access_token的详细信息,返回Json对象,与APIClient类的request_access_token类似。
     """
     r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'), access_token = access_token)
     # TODO 此处时间rtime,expires比较用处是何?
     current = int(time.time())
     expires = r.expire_in + current
     remind_in = r.get('remind_in', None)
     if remind_in:
         rtime = int(remind_in) + current
         if rtime < expires:
             expires = rtime
     return weibo.JsonDict(expires=expires, expires_in=expires, uid=r.get('uid', None))
コード例 #6
0
 def request_access_token_info(self, at):
     '''
     return access token as a JsonDict: {"access_token":"your-access-token","expires_in":12345678,"uid":1234}, expires_in is represented using standard unix-epoch-time
     '''
     r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'),
                          access_token=at)
     current = int(time.time())
     expires = r.expire_in + current
     remind_in = r.get('remind_in', None)
     if remind_in:
         rtime = int(remind_in) + current
         if rtime < expires:
             expires = rtime
     return weibo.JsonDict(expires=expires,
                           expires_in=expires,
                           uid=r.get('uid', None))
コード例 #7
0
ファイル: initclient.py プロジェクト: hukz37/python_crawler
 def request_access_token_info(self, at):
     """
     该接口传入参数at为已经授权的access_token,函数将返回该access_token的详细信息,返回Json对象,与APIClient类的request_access_token类似。
     """
     print '进入到了request_access_token_info函数'
     r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'),
                          access_token=at)
     current = int(time.time())
     expires = r.expire_in + current
     remind_in = r.get('remind_in', None)
     print '哈哈哈哈哈 %s' % (remind_in)
     if remind_in:
         rtime = int(remind_in) + current
         if rtime < expires:
             expires = rtime
     return weibo.JsonDict(expires=expires,
                           expires_in=expires,
                           uid=r.get('uid', None))
コード例 #8
0
 def request_access_token_info(self, access_token):
     r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'),
                          access_token=access_token)
     current = int(time.time())
     expires = r.expire_in + current
     return weibo.JsonDict(expires_in=expires)
コード例 #9
0
ファイル: node.py プロジェクト: huihuima1128/aobom
 def httpPost(self, url, data, **kwargs):
     kwargs.update(data)
     return _http_post(url, authorization=None, **kwargs)
コード例 #10
0
 def request_access_token_info(self, access_token):
     r = weibo._http_post('%s%s' % (self.auth_url, 'get_token_info'), access_token=access_token)
     current = int(tt.time())
     expires = r.expire_in + current
     return weibo.JsonDict(expires_in=expires)