当前位置: 首页>>代码示例>>Python>>正文


Python OAuthHandler.secure方法代码示例

本文整理汇总了Python中tweepy.OAuthHandler.secure方法的典型用法代码示例。如果您正苦于以下问题:Python OAuthHandler.secure方法的具体用法?Python OAuthHandler.secure怎么用?Python OAuthHandler.secure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tweepy.OAuthHandler的用法示例。


在下文中一共展示了OAuthHandler.secure方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
 def __init__(self, twitter_auth_params):
     '''
     Constructor
     '''
     auth = OAuthHandler(twitter_auth_params.getConsumerKey(), twitter_auth_params.getConsumerSecret())
     auth.secure = True
     auth.set_access_token(twitter_auth_params.getAccessTokenKey(), twitter_auth_params.getAccessTokenSecret())
     self.__twitterApi = API(auth)
开发者ID:jean-sebastien-dery,项目名称:TweetPlot,代码行数:10,代码来源:tweet_plot.py

示例2: start_twitter

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
def start_twitter():
    global api
    global auth

    auth = OAuthHandler(config['CONSUMER_TOKEN'], config['CONSUMER_SECRET'])
    auth.secure = True
    auth.set_access_token(config['ACCESS_TOKEN'],
                          config['ACCESS_TOKEN_SECRET'])
    api = API(auth)
开发者ID:Exploit-install,项目名称:DET,代码行数:11,代码来源:twitter.py

示例3: init_api

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
    def init_api(self):
        oauth_handler = TweepyOAuthHandler(
            self._consumer_key,
            self._consumer_secret)

        oauth_handler.secure = configuration.twitter['use_https']

        oauth_handler.set_access_token(self._access_token_key,
                                       self._access_token_secret)

        self._api = BaseTweepyApi(oauth_handler)
开发者ID:noisufnoc,项目名称:turses,代码行数:13,代码来源:backends.py

示例4: main

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
def main():
   	try:
		auth = OAuthHandler(consumer_key, consumer_secret)
		auth.secure = True
		auth.set_access_token(access_token, access_token_secret)
		api = API(auth)
		print(api.me().name)
		stream = Stream(auth, StdOutListener())
		stream.userstream()

    	except BaseException as e:
        	print("Error in main()", e)
开发者ID:zweed4u,项目名称:freeGuacAndChips,代码行数:14,代码来源:chipotleDM.py

示例5: main

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
def main():
    global api

    try:
        auth = OAuthHandler(CONSUMER_TOKEN, CONSUMER_SECRET)
        auth.secure = True
        auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)

        api = API(auth)
        stream = Stream(auth, StdOutListener())
        stream.userstream()

    except BaseException as e:
        print("Error in main()", e)
开发者ID:94883r,项目名称:twittor,代码行数:16,代码来源:implant.py

示例6: main

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
def main():

    try:
        auth = OAuthHandler(consumer_key, consumer_secret)
        auth.secure = True
        auth.set_access_token(access_token_key, access_token_secret)

        api = API(auth)

        # If the authentication was successful, you should
        # see the name of the account print out
        print(api.me().name)

        stream = Stream(auth, Listener())

        stream.userstream()

    except BaseException as e:
        print("Error in main()", e)
开发者ID:witty123,项目名称:twitter_bot,代码行数:21,代码来源:bot.py

示例7: main

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
def main():

    logger = logging.getLogger(__name__)
    logger.setLevel(logging.DEBUG)

    # create a file handler

    handler = logging.FileHandler('goddit.log')
    handler.setLevel(logging.INFO)

    # create a logging format

    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    handler.setFormatter(formatter)

    # add the handlers to the logger

    logger.addHandler(handler)

    try:
        auth = OAuthHandler(consumer_key, consumer_secret)
        auth.secure = True
        auth.set_access_token(access_token, access_token_secret)

        api = API(auth)

        # If the authentication was successful, you should
        # see the name of the account print out
        #print(api.me().name)

        stream = Stream(auth, tweetchazzer(api=api, logger=logger))

        s = stream.userstream()
        #while True:
        #    s = stream.filter(track=['tweetchazzer'])
        #print(str(s))

    except BaseException as e:
        print("Error in main()" +str(e))
开发者ID:pythononwheels,项目名称:goddit,代码行数:41,代码来源:goddit_listener.py

示例8: ConfigParser

# 需要导入模块: from tweepy import OAuthHandler [as 别名]
# 或者: from tweepy.OAuthHandler import secure [as 别名]
from py2neo import Graph
from neo4j import tweet_to_neo4j


#implement config parser to avoid showing secrets on github
config = ConfigParser()
config.read('config.ini')
consumer_key = config.get("twitter", "consumer_key")
consumer_secret = config.get("twitter", "consumer_secret")
access_token_key = config.get("twitter", "access_token_key")
access_token_secret = config.get("twitter", "access_token_secret")

#authoize th twitter stream
auth = OAuthHandler(consumer_key, consumer_secret)
auth.secure = True
auth.set_access_token(access_token_key, access_token_secret)

#neo4j graph
graph = Graph("http://neo4j:[email protected]:7474/db/data/")

class TwitterListener(StreamListener):
    """ A Handlers which sends tweets received by the string to the current RDD
    """
    def __init__(self):
      self.hashtag_bucket = []


    # def on_connect(self):
        # self.start_time = time.time()
        # time.sleep(1)
开发者ID:ReedJessen,项目名称:Reed_for_Yewno,代码行数:32,代码来源:run.py


注:本文中的tweepy.OAuthHandler.secure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。