Skip to content

Commit

Permalink
Remove API.update_profile_background_image
Browse files Browse the repository at this point in the history
Resolves tweepy#1466
The POST account/update_profile_background_image endpoint has been deprecated and removed, since background profile images have not been available or visible on Twitter.com since July 2015.
https://twittercommunity.com/t/upcoming-changes-to-the-developer-platform/104603
  • Loading branch information
Harmon758 committed Dec 19, 2020
1 parent af4611c commit 8dba191
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
9 changes: 0 additions & 9 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,6 @@ Account Methods
:rtype: :class:`User` object


.. method:: API.update_profile_background_image(filename)

Update authenticating user's background image. Valid formats: GIF, JPG, or
PNG

:param filename: local path to image file to upload. Not a remote URL!
:rtype: :class:`User` object


.. method:: API.update_profile([name], [url], [location], [description])

Sets values that users are able to set under the "Account" tab of their
Expand Down
3 changes: 0 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ def testupdateprofilecolors(self):
"""
def testupateprofileimage(self):
self.api.update_profile_image('examples/profile.png')
def testupdateprofilebg(self):
self.api.update_profile_background_image('examples/bg.png')
"""

@tape.use_cassette('testupdateprofilebannerimage.yaml', serializer='yaml')
Expand Down
15 changes: 0 additions & 15 deletions tweepy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,21 +702,6 @@ def update_profile_image(self, filename, file_=None):
require_auth=True
)(self, post_data=post_data, headers=headers)

def update_profile_background_image(self, filename, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_background_image
:allowed_param: 'tile', 'include_entities', 'skip_status', 'use'
"""
f = kwargs.pop('file', None)
headers, post_data = API._pack_image(filename, 800, f=f)
return 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
)(post_data=post_data, headers=headers)

def update_profile_banner(self, filename, **kwargs):
""" :reference: https://developer.twitter.com/en/docs/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner
:allowed_param: 'width', 'height', 'offset_left', 'offset_right'
Expand Down

0 comments on commit 8dba191

Please sign in to comment.