示例#1
0
 def handle_instagram_authorization(self):
     '''
     '''
     passCnt = 0
     user=instagramInt._handle_instagram_authorization()
     if 'access_token' in user:
         passCnt += mongoInt.insertTwitteTokens(instagramTokenCollectionName,user)
         return "Thanks buddy ! Instagram is authorized"
     logger.info('instagram_retrieved tokens is %s',user)
     return user
示例#2
0
 def handle_instagram_authorization(self):
     '''
     '''
     passCnt = 0
     user=instagramInt._handle_instagram_authorization()
     if 'access_token' in user:
         passCnt += mongoInt.insertTwitteTokens(instagramTokenCollectionName,user)
         return "Thanks buddy ! Instagram is authorized"
     logger.info('instagram_retrieved tokens is %s',user)
     return user
示例#3
0
 def insertTwitterAccessTokens(self,resp):
     ''' store the twitter access tokens of the user
     '''
     logger.debug('twitter authorized response:%s',resp)
     collName = 'twitter_Access_Tokens'
     nInserted = mongoInt.insertTwitteTokens(collName,resp)
     if nInserted:
         logger.debug('successful insert of twitter access token')
     else:
         logger.error('unable to insert the twitter access token')
     return nInserted
示例#4
0
 def insertTwitterAccessTokens(self,resp):
     ''' store the twitter access tokens of the user
     '''
     logger.debug('twitter authorized response:%s',resp)
     collName = 'twitter_Access_Tokens'
     nInserted = mongoInt.insertTwitteTokens(collName,resp)
     if nInserted:
         logger.debug('successful insert of twitter access token')
     else:
         logger.error('unable to insert the twitter access token')
     return nInserted
示例#5
0
def retrieveTwitterAccessTokens(collName):
        ''' retrieve access tokens from DB and pass it to twitterInt
        '''
        if mongoInt.checkCollExists(collName) < 1:
            ''' if the collection twitter_Access_Tokens is not availble initially
            populate the document with default tokens read from cfg files    '''
            logger.debug('default twitter token is:%s',globalS.dictDb['SATHISH_TOKEN'])
            if mongoInt.insertTwitteTokens(collName,globalS.dictDb['SATHISH_TOKEN']):
                logger.warn('twitter_Access_Tokens was empty added default token now')
        tokens = mongoInt.retrieveTwitterTokens(collName)
        logger.debug('tokens retrieved key secret : %s',tokens)
        return tokens
示例#6
0
def retrieveTwitterAccessTokens(collName = 'twitter_Access_Tokens'):
        ''' retrieve access tokens from DB and pass it to twitterInt
        '''
        if mongoInt.checkCollExists(collName) < 1:
            ''' if the collection twitter_Access_Tokens is not availble initially
            populate the document with default tokens read from cfg files    '''
            logger.debug('default twitter token is:%s',globalS.dictDb['SATHISH_TOKEN'])
            if mongoInt.insertTwitteTokens(collName,globalS.dictDb['SATHISH_TOKEN']):
                logger.warn('twitter_Access_Tokens was empty added default token now')
        tokens = mongoInt.retrieveTwitterTokens(collName)
        logger.debug('tokens retrieved key secerte : %s',tokens)
        return tokens