<filename>samples/authentication-as-user/python-requests_oauthlib/execute.py<gh_stars>1-10
#!/usr/bin/env python

from requests_oauthlib import OAuth1Session

# Configuring credentials
with open("../../../credentials.txt") as f:
    keys = f.readlines()
keys = [x.strip('\n') for x in keys]

# Building the request
twitter = OAuth1Session(keys[0],
                        client_secret=keys[1],
                        resource_owner_key=keys[2],
                        resource_owner_secret=keys[3])
url = "https://api.twitter.com/1.1/account/verify_credentials.json"

response = twitter.get(url)
print response.json()


<filename>samples/authentication-as-user/python-requests_oauthlib/execute.py<gh_stars>1-10
#!/usr/bin/env python

from requests_oauthlib import OAuth1Session

# Configuring credentials
with open("../../../credentials.txt") as f:
    keys = f.readlines()
keys = [x.strip('\n') for x in keys]

# Building the request
twitter = OAuth1Session(keys[0],
                        client_secret=keys[1],
                        resource_owner_key=keys[2],
                        resource_owner_secret=keys[3])
url = "https://api.twitter.com/1.1/account/verify_credentials.json"

response = twitter.get(url)
print response.json()


#!/usr/bin/env python # Configuring credentials # Building the request