How to use the twython.TwythonStreamer.__init__ function in twython

To help you get started, we’ve selected a few twython examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Humpheh / twied / src / twied / twicol / collection.py View on Github external
:Example:

        Following example is the usage of the :class:`TweetStreamer` that
        prints out the ID of each tweet when it is recieved. As the db is None
        no storage of the tweets is performed. `api_settings` is a dictionary
        of the Twitter API settings.

        >>> def test(name, data, insertid):
        >>>     print("Inserted with ID: %s" % insertid)
        >>>
        >>> ts = TweetStreamer("test", "twitter", db=None, callbacks=test, **api_settings)
        >>> ts.start()

        """
        Thread.__init__(self)
        TwythonStreamer.__init__(self, **kwargs)
        self.db = db
        self.name = name
        self.trackstr = trackstr
        self.running = True

        if not type(callbacks) == list:
            self.callbacks = [callbacks]
        else:
            self.callbacks = callbacks
github nltk / nltk / nltk / twitter / twitterclient.py View on Github external
def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret):

        self.handler = None
        self.do_continue = True
        TwythonStreamer.__init__(
            self, app_key, app_secret, oauth_token, oauth_token_secret
        )
github explosion / spaCy / examples / twitter_filter.py View on Github external
def __init__(self, keys_dir, nlp, query):
        keys_dir = pathlib.Path(keys_dir)
        read = lambda fn: (keys_dir / (fn + '.txt')).open().read().strip()
        api_key = map(read, ['key', 'secret', 'token', 'token_secret'])
        twython.TwythonStreamer.__init__(self, *api_key)
        self.nlp = nlp
        self.query = query
github third774 / twitter-christmas / app.py View on Github external
def __init__(self, a, b, c, d, lightControl):
        TwythonStreamer.__init__(self, a, b, c, d)
        self.lightControl = lightControl 
        lightControl.tick()
github dasfaha / twitter-location / TwitterLocationFilter.py View on Github external
def __init__(self, *kargs, **kwargs):
        self.f = open('brickLaneStream.log', 'a')
        TwythonStreamer.__init__(self, *kargs, **kwargs)
    def on_success(self, data):