Beispiel #1
0
 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
Beispiel #2
0
 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)
Beispiel #3
0
 def destroy_list(self, slug):
     return bind_api(
         path="/%s/lists/%s.json" % (self.auth.get_username(), slug),
         method="DELETE",
         payload_type="list",
         require_auth=True,
     )(self)
Beispiel #4
0
 def verify_credentials(self):
     try:
         return bind_api(path="/account/verify_credentials.json", payload_type="user", require_auth=True)(self)
     except TweepError, e:
         if e.response and e.response.status == 401:
             return False
         raise
Beispiel #5
0
 def remove_list_member(self, slug, *args, **kargs):
     return bind_api(
         path="/%s/%s/members.json" % (self.auth.get_username(), slug),
         method="DELETE",
         payload_type="list",
         allowed_param=["id"],
         require_auth=True,
     )(self, *args, **kargs)
Beispiel #6
0
 def update_list(self, slug, *args, **kargs):
     return bind_api(
         path="/%s/lists/%s.json" % (self.auth.get_username(), slug),
         method="POST",
         payload_type="list",
         allowed_param=["name", "mode", "description"],
         require_auth=True,
     )(self, *args, **kargs)
Beispiel #7
0
 def is_subscribed_list(self, owner, slug, user_id):
     try:
         return bind_api(path="/%s/%s/subscribers/%s.json" % (owner, slug, user_id), payload_type="user")(self)
     except TweepError:
         return False
Beispiel #8
0
 def test(self):
     try:
         bind_api(path="/help/test.json")(self)
     except TweepError:
         return False
     return True
Beispiel #9
0
 def update_profile_image(self, filename):
     headers, post_data = API._pack_image(filename, 700)
     return bind_api(
         path="/account/update_profile_image.json", method="POST", payload_type="user", require_auth=True
     )(self, post_data=post_data, headers=headers)
Beispiel #10
0
    followers_ids = bind_api(
        path="/followers/ids.json", payload_type="ids", allowed_param=["id", "user_id", "screen_name", "cursor"]
    )

    """ account/verify_credentials """

    def verify_credentials(self):
        try:
            return bind_api(path="/account/verify_credentials.json", payload_type="user", require_auth=True)(self)
        except TweepError, e:
            if e.response and e.response.status == 401:
                return False
            raise

    """ account/rate_limit_status """
    rate_limit_status = bind_api(path="/account/rate_limit_status.json", payload_type="json", use_cache=False)

    """ account/update_delivery_device """
    set_delivery_device = bind_api(
        path="/account/update_delivery_device.json",
        method="POST",
        allowed_param=["device"],
        payload_type="user",
        require_auth=True,
    )

    """ account/update_profile_colors """
    update_profile_colors = bind_api(
        path="/account/update_profile_colors.json",
        method="POST",
        payload_type="user",