Change password using Twitter API
Is there a way to change your twitter password through the python-twitter API, or the twitter API in general? I have looked around but cannot find this information ...
+3
user1023465
source
to share
2 answers
Luckily not ! Passwords are highly sensitive information that only Twitter itself wants to process.
Consider a third-party developer offering to change your Twitter password:
- Do you trust him and let him see your new password?
- How could you be sure that it actually sets your new password and not another?
+3
Stéphane Bruckert
source
to share
import urllib.request
import time
def set_password():
password="PASSWORDHERE"
set_password()
def send_to_twitter(msg):
password_manager = urllib.request.HTTPPasswordMgr()
password_manager.add_password("Twitter API",
"http://twitter.com/statuses", "twitterhandlehere",password)
http_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
page_opener = urllib.request.build_opener(http_handler)
urllib.request.install_opener(page_opener)
params = urllib.parse.urlencode( {'status': msg} )
resp = urllib.request.urlopen("http://twitter.com/statuses/update.json", params)
resp.read()
-1
DonaldTrump
source
to share