本文整理汇总了Python中tweepy.binder.bind_api函数的典型用法代码示例。如果您正苦于以下问题:Python bind_api函数的具体用法?Python bind_api怎么用?Python bind_api使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bind_api函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: exists_block
def exists_block(self, *args, **kargs):
try:
bind_api(path="/blocks/exists.json", allowed_param=["id", "user_id", "screen_name"], require_auth=True)(
self, *args, **kargs
)
except TweepError:
return False
return True
开发者ID:chatterbox-analytics,项目名称:tweepy,代码行数:8,代码来源:api.py
示例2: test
def test(self):
try:
bind_api(
path = '/help/test.json',
)(self)
except TweepError:
return False
return True
开发者ID:facesun,项目名称:xdtuxbot,代码行数:8,代码来源:api.py
示例3: update_profile_banner
def update_profile_banner(self, filename, *args, **kargs):
headers, post_data = API._pack_image(filename, 700, form_field="banner")
bind_api(
path = '/account/update_profile_banner.json',
method = 'POST',
allowed_param = ['width', 'height', 'offset_left', 'offset_right'],
require_auth = True
)(self, post_data=post_data, headers=headers)
开发者ID:joshwilliams,项目名称:tweepy,代码行数:8,代码来源:api.py
示例4: update_profile_image
def update_profile_image(self, filename):
headers, post_data = API._pack_image(filename, 700)
bind_api(
path = '/account/update_profile_image.json',
method = 'POST',
parser = parse_none,
require_auth = True
)(self, post_data=post_data, headers=headers)
开发者ID:fregen,项目名称:tweepy,代码行数:8,代码来源:api.py
示例5: update_profile_background_image
def update_profile_background_image(self, filename, *args, **kargs):
headers, post_data = API._pack_image(filename, 800)
bind_api(
path="/account/update_profile_background_image.json",
method="POST",
payload_type="user",
allowed_param=["tile"],
require_auth=True,
)(self, post_data=post_data, headers=headers)
开发者ID:pombredanne,项目名称:tweetspiral,代码行数:9,代码来源:api.py
示例6: update_profile_background_image
def update_profile_background_image(self, filename, *args, **kargs):
headers, post_data = API._pack_image(filename, 800)
bind_api(
path = '/account/update_profile_background_image.json',
method = 'POST',
payload_type = 'user',
allowed_param = ['tile'],
require_auth = True
)(self, post_data=post_data, headers=headers)
开发者ID:facesun,项目名称:xdtuxbot,代码行数:9,代码来源:api.py
示例7: exists_block
def exists_block(self, *args, **kargs):
try:
bind_api(
path = '/blocks/exists.json',
allowed_param = ['id', 'user_id', 'screen_name'],
require_auth = True
)(self, *args, **kargs)
except TweepError:
return False
return True
开发者ID:facesun,项目名称:xdtuxbot,代码行数:10,代码来源:api.py
示例8: update_profile_banner
def update_profile_banner(self, filename, **kargs):
""" :reference: https://dev.twitter.com/docs/api/1.1/post/account/update_profile_banner """
f = kargs.pop('file', None)
headers, post_data = API._pack_image(filename, 700, form_field="banner", f=f)
bind_api(
api=self,
path='/account/update_profile_banner.json',
method='POST',
allowed_param=['width', 'height', 'offset_left', 'offset_right'],
require_auth=True
)(self, post_data=post_data, headers=headers)
开发者ID:Gielpy,项目名称:tweepy,代码行数:11,代码来源:api.py
示例9: update_status_with_media
def update_status_with_media(self, filename, *args, **kargs):
headers, post_data = API._pack_media(filename, 3072)
bind_api(
path = '/statuses/update_with_media.json',
method = 'POST',
payload_type = 'status',
allowed_param = ['status'],
require_auth = True,
secure = True
)(self, post_data=post_data, headers=headers,
status=kargs.get('status', ''))
开发者ID:drdrang,项目名称:tweepy,代码行数:11,代码来源:api.py
示例10: update_profile_banner
def update_profile_banner(self, filename, **kargs):
""" :reference: https://dev.twitter.com/docs/api/1.1/post/account/update_profile_banner """
f = kargs.pop("file", None)
headers, post_data = API._pack_image(filename, 700, form_field="banner", f=f)
bind_api(
api=self,
path="/account/update_profile_banner.json",
method="POST",
allowed_param=["width", "height", "offset_left", "offset_right"],
require_auth=True,
)(self, post_data=post_data, headers=headers)
开发者ID:jamesfebin,项目名称:tweepy,代码行数:11,代码来源:api.py
示例11: update_profile_background_image
def update_profile_background_image(self, filename, **kargs):
""" :reference: https://dev.twitter.com/docs/api/1.1/post/account/update_profile_background_image """
f = kargs.pop("file", None)
headers, post_data = API._pack_image(filename, 800, f=f)
bind_api(
api=self,
path="/account/update_profile_background_image.json",
method="POST",
payload_type="user",
allowed_param=["tile", "include_entities", "skip_status", "use"],
require_auth=True,
)(self, post_data=post_data, headers=headers)
开发者ID:jamesfebin,项目名称:tweepy,代码行数:12,代码来源:api.py
示例12: update_profile_background_image
def update_profile_background_image(self, filename, **kargs):
""" :reference: https://dev.twitter.com/docs/api/1.1/post/account/update_profile_background_image """
f = kargs.pop('file', None)
headers, post_data = API._pack_image(filename, 800, f=f)
bind_api(
api=self,
path='/account/update_profile_background_image.json',
method='POST',
payload_type='user',
allowed_param=['tile', 'include_entities', 'skip_status', 'use'],
require_auth=True
)(self, post_data=post_data, headers=headers)
开发者ID:Gielpy,项目名称:tweepy,代码行数:12,代码来源:api.py
示例13: status_update_with_media
def status_update_with_media(self, filename, *args, **kargs):
"""
" https://dev.twitter.com/docs/api/1/post/statuses/update_with_media
"""
headers, post_data = API._pack_media(filename, 3072)
bind_api(
path = '/statuses/update_with_media.json',
method = 'POST',
payload_type = 'status',
allowed_param = ['status'],
require_auth = True,
upload_api = True,
secure = True
)(self, post_data=post_data, headers=headers, status=kargs.get('status', ''))
开发者ID:slothyrulez,项目名称:tweepy,代码行数:14,代码来源:api.py
示例14: search
def search(self, *args, **kargs):
return bind_api(
host = 'search.' + self.host,
path = '/search.json',
parser = parse_search_results,
allowed_param = ['q', 'lang', 'locale', 'rpp', 'page', 'since_id', 'geocode', 'show_user'],
)(self, *args, **kargs)
开发者ID:fregen,项目名称:tweepy,代码行数:7,代码来源:api.py
示例15: trends_available
def trends_available(self):
""" :reference: https://dev.twitter.com/rest/reference/get/trends/available """
return bind_api(
api=self,
path='/trends/available.json',
payload_type='json'
)
开发者ID:Xyborg,项目名称:tweepy,代码行数:7,代码来源:api.py
示例16: retweets
def retweets(self, id, *args, **kargs):
return bind_api(
path = '/statuses/retweets/%s.json' % id,
parser = parse_statuses,
allowed_param = ['count'],
require_auth = True
)(self, *args, **kargs)
开发者ID:1stvamp,项目名称:brumcon9-talk,代码行数:7,代码来源:api.py
示例17: get_user
def get_user(self):
""" :reference: https://dev.twitter.com/rest/reference/get/users/show
:allowed_param:'id', 'user_id', 'screen_name'
"""
return bind_api(
api=self, path="/users/show.json", payload_type="user", allowed_param=["id", "user_id", "screen_name"]
)
开发者ID:XinqiLi1992,项目名称:rickyli1992,代码行数:7,代码来源:api.py
示例18: update_status
def update_status(self, *args, **kwargs):
""" :reference: https://dev.twitter.com/rest/reference/post/statuses/update
:allowed_param:'status', 'in_reply_to_status_id', 'in_reply_to_status_id_str', 'lat', 'long', 'source', 'place_id', 'display_coordinates', 'media_ids'
"""
post_data = {}
media_ids = kwargs.pop("media_ids", None)
if media_ids is not None:
post_data["media_ids"] = list_to_csv(media_ids)
return bind_api(
api=self,
path="/statuses/update.json",
method="POST",
payload_type="status",
allowed_param=[
"status",
"in_reply_to_status_id",
"in_reply_to_status_id_str",
"lat",
"long",
"source",
"place_id",
"display_coordinates",
],
require_auth=True,
)(post_data=post_data, *args, **kwargs)
开发者ID:XinqiLi1992,项目名称:rickyli1992,代码行数:26,代码来源:api.py
示例19: verify_credentials
def verify_credentials(self):
try:
return bind_api(path="/account/verify_credentials.json", payload_type="user", require_auth=True)(self)
except TweepError as e:
if e.response and e.response.status == 401:
return False
raise
开发者ID:aozkan,项目名称:tweepy,代码行数:7,代码来源:api.py
示例20: unsubscribe_list
def unsubscribe_list(self, owner, slug):
return bind_api(
path = '/%s/%s/subscribers.json' % (owner, slug),
method = 'DELETE',
parser = parse_list,
require_auth = True
)(self)
开发者ID:1stvamp,项目名称:brumcon9-talk,代码行数:7,代码来源:api.py
注:本文中的tweepy.binder.bind_api函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论