Module for providing users easy access to all social networking websites The following piece of code will act as a single access to all social networks. It aims to connect different social networks to get a broader picture of the social life of a user. I have just committed the code for Twitter access, but similar access will be provided to Facebook and Github.

The code is available here.

I'd appreciate any and all comments-- correctness, style, best practices, logging, error handling.

import tweepy
import TwitterConfig as config_twitter

class Twitter :

def __init__(self):
    self.CONSUMER_KEY = config_twitter.get_consumer_key() 
    self.CONSUMER_SECRET = config_twitter.get_consumer_secret()
    self.oauth_token = None
    self.oauth_verifier = None
    self.api = None

def get_auth_url(self):
    self.auth = tweepy.OAuthHandler(self.CONSUMER_KEY, self.CONSUMER_SECRET)
    return self.auth.get_authorization_url()

def get_request_token(self):
    return (self.auth.request_token.key,self.auth.request_token.secret)

def set_token(self,token):
    self.oauth_token = token

def set_verifier(self,verifier):
    self.oauth_verifier = verifier

def set_request_token (self,ReqToken):
    self.request_token = ReqToken

def get_access_token (self):
    self.auth = tweepy.OAuthHandler(self.CONSUMER_KEY, self.CONSUMER_SECRET)
    token = self.request_token
    #session.delete('request_token')
    self.auth.set_request_token(token[0],token[1])
    self.auth.get_access_token(self.oauth_verifier)

def authorize (self):
    key = self.auth.access_token.key
    secret = self.auth.access_token.secret
    self.auth = tweepy.OAuthHandler(self.CONSUMER_KEY, self.CONSUMER_SECRET)
    self.auth.set_access_token(key, secret)
    self.api = tweepy.API(self.auth)

def update_status(self,status):
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return "Verification Problem"
    self.api.update_status (status)
    return "Done"

def user_information (self):
    # returns information of the authenticate user
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return "Verification Problem"
    return self.api.me()

def get_friends (self):
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return ["Verification Problem"]
    return self.api.GetFriends(self.user_information().name)

def get_followers (self):
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return ["Verification Problem"]
    return self.api.GetFollowers()

def get_followers_id (self):
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return "Verification Problem"
    return self.api.followers_ids()

def get_friends_ids (self):
    # returns ids of the friends
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return "Verification Problem"
    return self.api.friends_ids()

def get_rate_limit_status (self):
    #returns the rate limit status of the authenticated user
    return self.api.rate_limit_status()

def get_tweets(self):
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return ["Verification Problem"]
    me = self.user_information()
    statuses = self.api.GetUseerTimeline(me.name)
    return statuses

def get_messages(self):
    if self.oauth_token == None or self.oauth_verifier == None or self.api == None :
        return ["Verification Problem"]
    return self.api.GetDirectMessages()
You are inconsistent in naming. Some of your methods are in camelCase and some are in under_score format. Pick one.

Where is the consistent API for the various social networks?? From your write up I expect to be able to write something like the following:

my_friends = []
for soc in my_social_networks:
    my_friends.append(soc.get_friends())
show(my_friends)


or:

my_messages = []
for soc in my_social_networks:
    my_messages.append(soc.get_current_messages())
show(my_messages)


Instead I see get_tweets or get_wall. That means I have to pay attention to whether I have a Twitter object or a Facebook object. So all of my code needs to have a long if/else for each new type of social network I want to support in my program.

Double underscores are not meant for code outside of Python. Use a single underscore.