import time import generic import json #from pygeocoder import Geocoder #from multiprocessing import Pool import neo4jInterface import mongoInt import twitterInt import instagramInt import topicModel import facebookInt import loggerRecord import random from calendar import timegm #import sparkInt logger = loggerRecord.get_logger() facebookInt = facebookInt.facebookInt() neo4jInt = neo4jInterface.neo4jInterface() graphDB=neo4jInt.connect() #graphDB=neo4jInt.connect('localhost:7474/db/data/','neo4j','admin') #### # End of boilerplate, interesting code starts here: neo4jInt.createConstraint(graphDB) mongoInt=mongoInt.mongoInt() mconnect = mongoInt.connect() #sparkInt=sparkInt.sparkInt() def retrieveTwitterAccessTokens(collName): ''' retrieve access tokens from DB and pass it to twitterInt '''
#logger.debug('global app file# %s',app.config) logger.info(''' .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | | _____ _____ | || | ____ | || | _____ _____ | || | ______ | || | _____ | || | ______ | | | ||_ _||_ _|| || | .' `. | || ||_ _||_ _|| || | .' ___ | | || | |_ _| | || | .' ___ | | | | | | | /\ | | | || | / .--. \ | || | | | /\ | | | || | / .' \_| | || | | | | || | / .' \_| | | | | | |/ \| | | || | | | | | | || | | |/ \| | | || | | | ____ | || | | | | || | | | | | | | | /\ | | || | \ `--' / | || | | /\ | | || | \ `.___] _| | || | _| |_ | || | \ `.___.'\ | | | | |__/ \__| | || | `.____.' | || | |__/ \__| | || | `._____.' | || | |_____| | || | `._____.' | | | | | || | | || | | || | | || | | || | | | | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' ''') #app.logger.addHandler(fhandler) #associate the app logger with general logger app.logger_name = loggerRecord.get_logger( ) #associate the app logger with general logger #### #43apps access strings #oAuthStrings = dict(T_CONSUMER_KEY= 'HwvpHtsPt3LmOZocZXwtn72Zv', #T_CONSUMER_SECRET = 'afVEAR0Ri3ZluVItqbDi0kfm7BHSxjwRXbpw9m9kFhXGjnzHKh') # #globalS.dictDb.update(oAuthStrings) import intercom intercom = intercom.intercom() @app.route('/') def index(): ''' this is just to check the index url is working '''
#! /usr/bin/python #=============================================================================== # File Name : .py # Date : 12-20-2015 # Input Files : Nil # Author : Satheesh <*****@*****.**> # Description : This file just interfaces to neo4J and brings you the handle so that multiple files can # #=============================================================================== import loggerRecord,globalS logger = loggerRecord.get_logger() #### # Get tweepy set up import tweepy #from tweepy import RateLimitHandler #import time #from tweepy import Cursor #some concreete solutiuon has to be implemented below is just junk HOT fix #keys from twitter is stored here temp will be removed once we access the user credentials from mongoDB and load it to globalDict file #globalS.dictDb.update(oAuthStrings) #{ sathishsms :{'56276642-bOJMDDbpy7B2gCryxMfWgMDGrxgP9NnPJzgMV5fTS':'iMGjh3MkFGS0yudhe9SadUH5Dxwk9ndiAPrXTE6ivyqr8' } ACCESS_TOKENS = [{'oauth_token_secret': 'iMGjh3MkFGS0yudhe9SadUH5Dxwk9ndiAPrXTE6ivyqr8', 'oauth_token': '56276642-bOJMDDbpy7B2gCryxMfWgMDGrxgP9NnPJzgMV5fTS'}, {u'oauth_token_secret': 'iMGjh3MkFGS0yudhe9SadUH5Dxwk9ndiAPrXTE6ivyqr8', 'oauth_token': '56276642-bOJMDDbpy7B2gCryxMfWgMDGrxgP9NnPJzgMV5fTS'}] class twitterInt: ''' this class is meant for twitter ''' api=''#universal twitter api
""" .----------------. .----------------. .----------------. .----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | | _____ _____ | || | ____ | || | _____ _____ | || | ______ | || | _____ | || | ______ | | | ||_ _||_ _|| || | .' `. | || ||_ _||_ _|| || | .' ___ | | || | |_ _| | || | .' ___ | | | | | | | /\ | | | || | / .--. \ | || | | | /\ | | | || | / .' \_| | || | | | | || | / .' \_| | | | | | |/ \| | | || | | | | | | || | | |/ \| | | || | | | ____ | || | | | | || | | | | | | | | /\ | | || | \ `--' / | || | | /\ | | || | \ `.___] _| | || | _| |_ | || | \ `.___.'\ | | | | |__/ \__| | || | `.____.' | || | |__/ \__| | || | `._____.' | || | |_____| | || | `._____.' | | | | | || | | || | | || | | || | | || | | | | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------' '----------------' '----------------' '----------------' """ ) # app.logger.addHandler(fhandler) #associate the app logger with general logger app.logger_name = loggerRecord.get_logger() # associate the app logger with general logger #### # 43apps access strings # oAuthStrings = dict(T_CONSUMER_KEY= 'HwvpHtsPt3LmOZocZXwtn72Zv', # T_CONSUMER_SECRET = 'afVEAR0Ri3ZluVItqbDi0kfm7BHSxjwRXbpw9m9kFhXGjnzHKh') # # globalS.dictDb.update(oAuthStrings) import intercom intercom = intercom.intercom() @app.route("/") def index():