Last active
August 29, 2015 14:01
-
-
Save szolotykh/715347c7e50c84b54090 to your computer and use it in GitHub Desktop.
Python script is update status on twitter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import os | |
# Consumer keys and access tokens, used for OAuth | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' | |
access_token_secret = '' | |
# OAuth process, using the keys and tokens | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
# Creation of the actual interface, using authentication | |
api = tweepy.API(auth) | |
# Creates the user object | |
user = api.me() | |
print('Name: ' + user.name) | |
print('Location: ' + user.location) | |
print('Friends: ' + str(user.friends_count)) | |
# Update status | |
# api.update_status('Hello Form RBI Lab!') | |
# load image | |
imagePath = "path\img.jpg" | |
status = "Hello! From Python script" | |
# Update status with imsge | |
api.update_with_media(imagePath, status) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment