You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
``setProxy(<dict>)`` Sets a proxy. Because only HTTPS requests are done, it's sufficient to only input a dict containing a ``https`` entry ``setProxy({'https':'10.0.0.1:123'})``
``authenticate(verify=<boolean>)`` Creates an authenticated oauth2 client and if ``verify`` is true, it also checkes if the user credentials are valid. The **default** value is *True* ``authenticate()``, ``authenticate(True)``
``searchTweetsIterable(<TwitterSearchOrder>)`` Queries the Twitter API, iterates through tweets and reloads available older tweets automatically see `Basic usage <basic_usage.html>`_
``searchTweets(<TwitterSearchOrder>)`` Queries the Twitter API **without** iterating or reloading of further results and returns response see `Advanced usage`_
``getStatistics()`` Returns a dict of the type ``{ 'queries' : <int>, 'tweets' : <int> }`` with statistical values about the number of queries and the sum of all tweets recieved by this very instance of *TwitterSearch* ``print "Queries done %i / Tweets received %i" % (ts.getStatistics()['queries'], ts.getStatistics()['tweets'])``
``checkHTTPStatus(<int>)`` Checks if given HTTP status code is in ``TwitterSearch.exceptions`` and raises ``TwitterSearchException`` if this is the case ``checkHTTPStatus(200)``, ``checkHTTPStatus(401)``
``setProxy(<dict>)`` Sets a proxy. Because only HTTPS requests are done, it's sufficient to only input a dict containing a ``https`` entry ``setProxy({'https':'10.0.0.1:123'})``
``authenticate(verify=<boolean>)`` Creates an authenticated oauth2 client and if ``verify`` is true, it also checkes if the user credentials are valid. The **default** value is *True* ``authenticate()``, ``authenticate(True)``
``searchTweetsIterable(<TwitterSearchOrder>)`` Queries the Twitter API, iterates through tweets and reloads available older tweets automatically see `Basic usage <basic_usage.html>`_
``searchTweets(<TwitterSearchOrder>)`` Queries the Twitter API **without** iterating or reloading of further results and returns response see `Advanced usage`_
``getStatistics()`` Returns a dict of the type ``{ 'queries' : <int>, 'tweets' : <int> }`` with statistical values about the number of queries and the sum of all tweets recieved by this very instance of *TwitterSearch* ``print "Queries done %i / Tweets received %i" % (ts.getStatistics()['queries'], ts.getStatistics()['tweets'])``
``checkHTTPStatus(<int>)`` Checks if given HTTP status code is in ``TwitterSearch.exceptions`` and raises ``TwitterSearchException`` if this is the case ``checkHTTPStatus(200)``, ``checkHTTPStatus(401)``
``setSupportedLanguages(<TwitterSearchOrder>)`` Loads currently supported languages from Twitter and stores them in a ``TwitterSearchOrder`` instance see `Advanced usage`_
The methods ``next()``, ``__next__()`` and ``__iter__()`` are used during the iteration process. For more information about those methods please consult the `official Python documentation <http://docs.python.org/2/library/stdtypes.html#iterator-types>`_.
36
38
@@ -281,3 +283,31 @@ A possible solution could look like this:
281
283
except TwitterSearchException as e:
282
284
print(e)
283
285
286
+
On-the-fly loading of supported languages
287
+
+++++++++++++++++++++++++++++++++++++++++
288
+
289
+
As you may have figured out some languages are not supported by Twitter and those that are may change over time. This is why Twitter does provide `an endpoint <https://dev.twitter.com/docs/api/1.1/get/help/languages>`_ to load all currently supported languages. You may query it to gather current information about the languages in Twitter.
0 commit comments