2009-08-14 7 views
0

私のプロフィール情報をpython-twitter moduleで更新しようとしています。python-twitterでプロフィールを更新する

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

問題は、それが更新さを取得されていないし、私が行う必要がある別のステップがあるかどうドキュメントが不明であるということですが - 私は電話またはそのような何かする必要があることを「保存」がありますか?

答えて

1

私はpython-twitterモジュールが現在プロファイルの更新をサポートしているとは思っていません。 SetLocationは、GetUserが返したローカルユーザーオブジェクトのみを更新します。

これをモジュールに追加するのは比較的簡単です。

account/update_profile

をして、更新されたユーザデータと update_profile/アカウントを呼び出すAPIクラスに新しいメソッドを追加します。この方法を見てみましょう。

+0

おかげで利用可能なメソッドの一覧を見ることができます

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) 

、私は私が行方不明になった場合だけ不思議、APIに精通しています本当に基本的なもので、私が変更を保存するのを妨げていました。明らかにそうではありません。乾杯。 –

0

これは、ユーザーからのプロファイルメソッドのセットです:あなたがhttp://static.unto.net/python-twitter/0.6/doc/twitter.html

+0

Junajo - あなたは十分深く見ていません:SetProfileImageUrl(..)はリモートコマンドを発行しません、クラスのデータメンバーを設定するだけです。私はhttps://github.com/jaytaylor/python-twitter-apiでtwitter libのアップデート版をリリースします。これは実際にプロフィール画像のURLを設定します。私が最初に公開したときにここにポストバックすることを覚えようとします。それは来週中に準備ができていると予想しています。 –

関連する問題