Форум сайта python.su
Здравствуйте уважаемые формучане.
У меня проблема с использованием одной из функций tweepy, а именно
http://code.google.com/p/tweepy/wiki/APIReference#update_profile_background_image update_profile_background_image Update authenticating user's background image. Valid formats: GIF, JPG, or PNG Parameters: filename (Path to image file. Required), tile Returns: User object
https://dev.twitter.com/docs/api/1/post/account/update_profile_background_image filename - The background image for the profile, base64-encoded. Must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be forcibly scaled down. The image must be provided as raw multipart data, not a URL. tile - Whether or not to tile the background image. If set to true, t or 1 the background image will be displayed tiled. The image will not be tiled otherwise.
api.update_profile_background_image(filename=TEXTURES+random.choice(os.listdir(TEXTURES)),tile=1)
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)
Офлайн