views:

147

answers:

2

I am trying to update my Profile info via python-twitter module.

>>> api = twitter.Api(username="username", password="password")
>>> user = api.GetUser(user="username")
>>> user.SetLocation('New Location')

The problem is that it is not getting updated and the documentation is unclear if there's another step I need to do - is there a "save" that I need to call or something like that?

+1  A: 

I don't believe that the python-twitter module currently supports updating a profile. SetLocation will only update your local user object that GetUser has returned.

It would be relatively trivial to add support for this to the module though. Have a look at this method:

account/update_profile

and then add a new method to the Api class that calls account/update_profile with the updated user data.

DisplacedAussie
Thanks, I am familiar with the API, just wondering if I was missing something really basic that was preventing me from saving the changes. Clearly not. Cheers.
Kunal Dua
A: 

This are the set*profile* methods from User:

SetProfileBackgroundColor(self, profile_background_color)

SetProfileBackgroundImageUrl(self, profile_background_image_url)

SetProfileBackgroundTile(self, profile_background_tile)
    Set the boolean flag for whether to tile the profile background image.

    Args:
      profile_background_tile: Boolean flag for whether to tile or not.

SetProfileImageUrl(self, profile_image_url)
    Set the url of the thumbnail of this user.

    Args:
      profile_image_url: The url of the thumbnail of this user

SetProfileLinkColor(self, profile_link_color)

SetProfileSidebarFillColor(self, profile_sidebar_fill_color)

SetProfileTextColor(self, profile_text_color)

You can see a list of available methods at http://static.unto.net/python-twitter/0.6/doc/twitter.html

Juanjo Conti