diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..eb59bbc7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,20 @@ +version: 2 +jobs: + build: + working_directory: ~/repo + docker: + - image: jeremylow/python-twitter + steps: + - checkout + - run: sudo chown -R circleci:circleci ~/repo + - run: + name: set up pyenv + command: pyenv local 2.7.15 3.7.1 pypy-5.7.1 pypy3.5-6.0.0 + - run: + name: install deps + command: pip install -r requirements.testing.txt + - run: + name: run tests + command: | + export PATH=/home/circleci/.local/bin:$PATH + make tox diff --git a/.circleci/images/Dockerfile b/.circleci/images/Dockerfile new file mode 100644 index 00000000..04d96343 --- /dev/null +++ b/.circleci/images/Dockerfile @@ -0,0 +1,21 @@ +# We could use a smaller image, but this ensures that everything CircleCI needs +# is installed already. +FROM circleci/python:3.6 +MAINTAINER Jeremy Low + +# These are the version of python currently supported. +ENV SUPPORTED_VERSIONS="2.7.15 3.7.1 pypy-5.7.1 pypy3.5-6.0.0" +ENV PYENV_ROOT /home/circleci/.pyenv +ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH + +# Get and install pyenv. +RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash + +# pyenv installer doesn't set these for us. +RUN echo "export PATH=${PYENV_ROOT}/bin:$$PATH \n\ +eval '\$(pyenv init -)' \n\ +eval '\$(pyenv virtualenv-init -)'" >> ~/.bashrc +RUN pyenv update + +# Install each supported version into the container. +RUN for i in $SUPPORTED_VERSIONS; do pyenv install "$i"; done diff --git a/.gitignore b/.gitignore index cfadd8d1..f5955911 100644 --- a/.gitignore +++ b/.gitignore @@ -18,13 +18,23 @@ var sdist develop-eggs .installed.cfg +.eggs +.cache +.vscode # Installer logs pip-log.txt # Unit test / coverage reports .coverage +.codecov-token .tox +htmlcov +.tox +nosetests.xml +htmlcov +coverage.xml +.hypothesis # PyCharm data .idea @@ -37,3 +47,15 @@ pip-log.txt #Environment env +.python-version + +violations.flake8.txt + +# Built docs +doc/_build/** + +# Mypy cache +**/.mypy_cache + +# VS Code +**/.vscode diff --git a/AUTHORS.rst b/AUTHORS.rst index 112d6fe7..adb00cfa 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -21,10 +21,12 @@ Now it's a full-on open source project with many contributors over time: * Pradeep Nayak, * Ian Ozsvald, * Nicolas Perriault, +* Trevor Prater, * Glen Tregoning, * Lars Weiler, * Sebastian Wiesinger, * Jake Robinson, +* Muthu Annamalai, * abloch, * cahlan, * dpslwk, @@ -33,4 +35,4 @@ Now it's a full-on open source project with many contributors over time: * git-matrix, * sbywater, * thefinn93, -* themylogin, \ No newline at end of file +* themylogin, diff --git a/CHANGES b/CHANGES index 05c17644..3af38784 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,43 @@ +2016-05-25 + Going forward all changes will be tracked in docs/changelog.rst + +2015-12-28 + Large number of changes related to making the code Python v3 compatible. + See the messy details at https://github.com/bear/python-twitter/pull/251 + + Pull Requests + #525 Adds support for 280 character limit for tweets by trevorprater + #267 initialize Api.__auth fixes #119 by rbpasker + #266 Add full_text and page options in GetDirectMessages function by mistersalmon + #264 Updates Media object with new methods, adds id param, adds tests by jeremylow + #262 Update get_access_token.py by lababidi + #261 Adding Collections by ryankicks + #260 Added UpdateBackgroundImage method and added profile_link_color argument to UpdateProfile by BrandonBielicki + #259 Added GetFriendIDsPaged by RockHoward + #254 Adding api methods for suggestions and suggestions/:slug by trentstollery + #253 Added who parameter to api.GetSearch by wilsonand1 + #250 adds UpdateFriendship (shared Add/Edit friendship) by jheld + #249 Fixed Non-ASCII printable representation in Trend by der-Daniel + #246 Add __repr__ for status by era + #245 Python-3 Fix: decode bytestreams for json load by ligthyear + #243 Remove references to outdated API functionality: GetUserByEmail by Vector919 + #239 Correct GetListsList docstring by tedmiston + + Probably a whole lot that I missed - ugh! + +2017-11-11 + Added support for 280 character limit + +2015-10-05 + Added who to api.GetSearch + +2014-12-29 + removed reference to simplejson + 2014-12-24 bump version to v2.3 bump version to v2.2 + PEP8 standardization 2014-07-10 bump version to v2.1 @@ -50,7 +87,7 @@ need to backfill commit log entries! 2013-06-07 changed version to 1.0.1 added README bit about Python version requirement - + 2013-06-04 changed version to 1.0 removed doc directory until we can update docs for v1.1 API @@ -67,7 +104,7 @@ need to backfill commit log entries! removed GetPublicTimeline from the docs so as to stop confusing new folks since it was the first example given ... d'oh! - + 2013-02-10 bumped version to 0.8.6 @@ -91,7 +128,7 @@ need to backfill commit log entries! to push to PyPI and other places all work now will be on getting the v1.1 API supported - + 2012-11-04 https://github.com/bear/python-twitter/issues/4 Api.UserLookUp() throws attribute error when corresponding screen_name is not found diff --git a/GAE.rst b/GAE.rst new file mode 100644 index 00000000..4429e02f --- /dev/null +++ b/GAE.rst @@ -0,0 +1,55 @@ +================================================ +How to use python-twitter with Google App Engine +================================================ + +********** +Background +********** + +Google App Engine uses virtual machines to do work and serve your application's content. In order to make a 'regular' external web request, the instance must use the built-in urlfetch library provided by Google in addition to the traditional python requests library. As a result, a few extra steps must be followed to use python-twitter on App Engine. + + +************* +Prerequisites +************* + +Follow the `third party vendor library install instructions `_ to include the dependency libraries listed in ``requirements.txt``: ``requests``, ``requests_oauthlib`` and ``requests_toolbelt``, as well as ``python-twitter`` library. Typically you can just place the module folders into the same place as your app.yaml file; it might look something like this: + +| myapp/ +| ├── twitter/ +| ├── requests_oauthlib/ +| ├── requests_toolbelt/ +| ├── main.py +| └── app.yaml + + +******** +app.yaml +******** + +In order to use HTTPS, you'll have to make sure the built-in SSL library is properly imported in your ``app.yaml`` file. Here's what that section of your ``app.yaml`` file might look like: + +| libraries: +| - name: jinja2 +| version: latest +| - name: webapp2 +| version: latest +| - name: ssl +| version: latest + + +**************************** +Limitations & Considerations +**************************** + +Caching +^^^^^^^ +When using twitter-python on App Engine, caching is disabled. You'll have to add and manage App Engine's memcache logic on your own if you require any caching beyond what is probably already setup on App Engine by default. + +Datastore +^^^^^^^^^ +If you plan to store tweets or other information returned by the API in Datastore, you'll probably want to make your own NDP models to store the desired components of the response rather than shoving the whole response into an entity. + +Sockets +^^^^^^^^^ +When urllib3 is imported on App Engine it will throw a warning about sockets: ``AppEnginePlatformWarning: urllib3 is using URLFetch on Google App Engine sandbox...`` This is just a warning that you'd have to use the Sockets API if you intend to use the sockets feature of the library, which we don't use in python-twitter so it can be ignored. diff --git a/MANIFEST.in b/MANIFEST.in index 0fb7f7a9..ca78efe0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,4 +3,6 @@ include COPYING include LICENSE include NOTICE include *.rst +include requirements.txt prune .DS_Store +graft doc examples testdata tests diff --git a/Makefile b/Makefile index a65311b4..76039c40 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,71 @@ -.PHONY: docs test +SUPPORTED_VERSIONS = 2.7.15 3.6.5 pypy-5.7.1 pypy3.5-6.0.0 help: - @echo " env create a development environment using virtualenv" - @echo " deps install dependencies" + @echo " env install all production dependencies" + @echo " dev install all dev and production dependencies (virtualenv is assumed)" + @echo " docs build documentation" @echo " clean remove unwanted stuff" @echo " lint check style with flake8" @echo " test run tests" + @echo " coverage run tests with code coverage" env: - sudo easy_install pip && \ - pip install virtualenv && \ - virtualenv env && \ - . env/bin/activate && \ - make deps + pip install -Ur requirements.txt -deps: - pip install -r requirements.txt --use-mirrors +pyenv: + for version in $(SUPPORTED_VERSIONS) ; do \ + pyenv install -s $$version; \ + done + pyenv local $(SUPPORTED_VERSIONS) + +dev: pyenv env + pip install -Ur requirements.testing.txt + +info: + @python --version + @pyenv --version + @pip --version clean: - rm -fr build \ - rm -fr dist \ - find . -name '*.pyc' -exec rm -f {} \ - find . -name '*.pyo' -exec rm -f {} \ - find . -name '*~' -exec rm -f {} + rm -fr build + rm -fr dist + find . -name '*.pyc' -exec rm -f {} \; + find . -name '*.pyo' -exec rm -f {} \; + find . -name '*~' ! -name '*.un~' -exec rm -f {} \; + +docs: + $(MAKE) -C doc html lint: - flake8 twitter > violations.flake8.txt + pycodestyle --config={toxinidir}/setup.cfg twitter tests + +test: lint + pytest -s + #python setup.py test + +tox: clean + tox + +coverage: clean + coverage run --source=twitter setup.py test --addopts "--ignore=venv" + coverage html + coverage report + +update-pyenv: + cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd - + +ci: update-pyenv pyenv dev tox + CODECOV_TOKEN=`cat .codecov-token` codecov -test: - python twitter_test.py +build: clean + python setup.py check + python setup.py sdist + python setup.py bdist_wheel +upload: clean + pyenv 2.7.15 + python setup.py sdist upload + python setup.py bdist_wheel upload + pyenv 3.6.5 + python setup.py bdist_wheel upload + pyenv local $(SUPPORTED_VERSIONS) diff --git a/README.rst b/README.rst index 34300fbe..bed3afb3 100644 --- a/README.rst +++ b/README.rst @@ -2,19 +2,21 @@ Python Twitter A Python wrapper around the Twitter API. -By the Python-Twitter Developers +By the `Python-Twitter Developers `_ -.. image:: https://pypip.in/wheel/python-twitter/badge.png - :target: https://pypi.python.org/pypi/python-twitter/ - :alt: Wheel Status +============ +NOTICE +============ +I've archived this repo to mark that I'm not going to be maintaining it. It's open-source so anyone using it can fork or take it over. +Thank you to all the people that contributed to it in the past ============ Introduction ============ -This library provides a pure Python interface for the `Twitter API https://dev.twitter.com/`. It works with Python versions from 2.6+. Python 3 support is under development. +This library provides a pure Python interface for the `Twitter API `_. It works with Python versions from 2.7+ and Python 3. -`Twitter http://twitter.com` provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a `web services API https://dev.twitter.com/overview/documentation` and this library is intended to make it even easier for Python programmers to use. +`Twitter `_ provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a `web services API `_ and this library is intended to make it even easier for Python programmers to use. ========== Installing @@ -24,10 +26,10 @@ You can install python-twitter using:: $ pip install python-twitter -Testing:: - $ python twitter_test.py - +If you are using python-twitter on Google App Engine, see `more information `_ about including 3rd party vendor library dependencies in your App Engine project. + + ================ Getting the code ================ @@ -38,53 +40,84 @@ Check out the latest development version anonymously with:: $ git clone git://github.com/bear/python-twitter.git $ cd python-twitter - -Setup a virtual environment and install dependencies: - $ make env +To install dependencies, run either:: + + $ make dev + +or:: -Activate the virtual environment created: + $ pip install -Ur requirements.testing.txt + $ pip install -Ur requirements.txt - $ source env/bin/activate - -Run tests: +Note that ```make dev``` will install into your local ```pyenv``` all of the versions needed for test runs using ```tox```. - $ make test - -To see other options available, run: +To install the minimal dependencies for production use (i.e., what is installed +with ``pip install python-twitter``) run:: - $ make help + $ make env +or:: + + $ pip install -Ur requirements.txt + +============= +Running Tests +============= +The test suite can be run against a single Python version or against a range of them depending on which Makefile target you select. + +Note that tests require ```pip install pytest``` and optionally ```pip install pytest-cov``` (these are included if you have installed dependencies from ```requirements.testing.txt```) + +To run the unit tests with a single Python version:: + + $ make test + +to also run code coverage:: + + $ make coverage + +To run the unit tests against a set of Python versions:: + + $ make tox ============= Documentation ============= -View the last release API documentation at: https://dev.twitter.com/overview/documentation +View the latest python-twitter documentation at +https://python-twitter.readthedocs.io. You can view Twitter's API documentation at: https://dev.twitter.com/overview/documentation ===== Using ===== -The library provides a Python wrapper around the Twitter API and the Twitter data model. +The library provides a Python wrapper around the Twitter API and the Twitter data model. To get started, check out the examples in the examples/ folder or read the documentation at https://python-twitter.readthedocs.io which contains information about getting your authentication keys from Twitter and using the library. ----- +------------------ Using with Django ----- +------------------ -Additional template tags that expand tweet urls and urlize tweet text. See the django template tags available for use with python-twitter: https://github.com/radlws/python-twitter-django-tags +Additional template tags that expand tweet urls and urlize tweet text. See the django template tags available for use with python-twitter: https://github.com/radzhome/python-twitter-django-tags ------ -Model ------ +------ +Models +------ -The three model classes are ``twitter.Status``, ``twitter.User``, and ``twitter.DirectMessage``. The API methods return instances of these classes. +The library utilizes models to represent various data structures returned by Twitter. Those models are: + * twitter.Category + * twitter.DirectMessage + * twitter.Hashtag + * twitter.List + * twitter.Media + * twitter.Status + * twitter.Trend + * twitter.Url + * twitter.User + * twitter.UserStatus -To read the full API for ``twitter.Status``, ``twitter.User``, or ``twitter.DirectMessage``, run:: +To read the documentation for any of these models, run:: - $ pydoc twitter.Status - $ pydoc twitter.User - $ pydoc twitter.DirectMessage + $ pydoc twitter.[model] --- API @@ -92,9 +125,17 @@ API The API is exposed via the ``twitter.Api`` class. -The python-twitter library now only supports oAuth authentication as the Twitter devs have indicated that OAuth is the only method that will be supported moving forward. +The python-twitter requires the use of OAuth keys for nearly all operations. As of Twitter's API v1.1, authentication is required for most, if not all, endpoints. Therefore, you will need to register an app with Twitter in order to use this library. Please see the "Getting Started" guide on https://python-twitter.readthedocs.io for more information. + +To generate an Access Token you have to pick what type of access your application requires and then do one of the following: -To create an instance of the ``twitter.Api`` with login credentials (Twitter now requires an oAuth Access Token for all API calls):: +- `Generate a token to access your own account `_ +- `Generate a pin-based token `_ +- use the helper script `get_access_token.py `_ + +For full details see the `Twitter OAuth Overview `_ + +To create an instance of the ``twitter.Api`` with login credentials (Twitter now requires an OAuth Access Token for all API calls):: >>> import twitter >>> api = twitter.Api(consumer_key='consumer_key', @@ -104,58 +145,64 @@ To create an instance of the ``twitter.Api`` with login credentials (Twitter now To see if your credentials are successful:: - >>> print api.VerifyCredentials() + >>> print(api.VerifyCredentials()) {"id": 16133, "location": "Philadelphia", "name": "bear"} **NOTE**: much more than the small sample given here will print -To fetch a single user's public status messages, where ``user`` is a Twitter *short name*:: +To fetch a single user's public status messages, where ``user`` is a Twitter user's screen name:: >>> statuses = api.GetUserTimeline(screen_name=user) - >>> print [s.text for s in statuses] + >>> print([s.text for s in statuses]) -To fetch a list a user's friends (requires authentication):: +To fetch a list of a user's friends:: >>> users = api.GetFriends() - >>> print [u.name for u in users] + >>> print([u.name for u in users]) -To post a Twitter status message (requires authentication):: +To post a Twitter status message:: >>> status = api.PostUpdate('I love python-twitter!') - >>> print status.text + >>> print(status.text) I love python-twitter! -There are many more API methods, to read the full API documentation:: +There are many more API methods, to read the full API documentation either +check out the documentation on `readthedocs +`_, build the documentation locally +with:: - $ pydoc twitter.Api + $ make docs +or check out the inline documentation with:: + $ pydoc twitter.Api ----- +------ Todo ----- +------ -Patches and bug reports are [welcome](https://github.com/bear/python-twitter/issues/new), just please keep the style consistent with the original source. +Patches, pull requests, and bug reports are `welcome `_, just please keep the style consistent with the original source. -Add more example scripts. +In particular, having more example scripts would be a huge help. If you have +a program that uses python-twitter and would like a link in the documentation, +submit a pull request against ``twitter/doc/getting_started.rst`` and add your +program at the bottom. The twitter.Status and ``twitter.User`` classes are going to be hard to keep in sync with the API if the API changes. More of the code could probably be written with introspection. -Statement coverage of ``twitter_test`` is only about 80% of twitter.py. - The ``twitter.Status`` and ``twitter.User`` classes could perform more validation on the property setters. ---------------- More Information ---------------- -Please visit `the google group http://groups.google.com/group/python-twitter` for more discussion. +Please visit `the google group `_ for more discussion. ------------ Contributors ------------ -Originally two libraries by DeWitt Clinton and Mike Taylor which was then merged into python-twitter. +Originally two libraries by DeWitt Clinton and Mike Taylor which were then merged into python-twitter. Now it's a full-on open source project with many contributors over time. See AUTHORS.rst for the complete list. @@ -163,14 +210,14 @@ Now it's a full-on open source project with many contributors over time. See AUT License ------- -| Copyright 2007-2014 The Python-Twitter Developers -| +| Copyright 2007-2016 The Python-Twitter Developers +| | Licensed under the Apache License, Version 2.0 (the 'License'); | you may not use this file except in compliance with the License. | You may obtain a copy of the License at -| +| | http://www.apache.org/licenses/LICENSE-2.0 -| +| | Unless required by applicable law or agreed to in writing, software | distributed under the License is distributed on an 'AS IS' BASIS, | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/coveragerc b/coveragerc new file mode 100644 index 00000000..1d7881d5 --- /dev/null +++ b/coveragerc @@ -0,0 +1,2 @@ +[run] +source = twitter diff --git a/doc/_build/doctrees/environment.pickle b/doc/_build/doctrees/environment.pickle deleted file mode 100644 index 0948e772..00000000 Binary files a/doc/_build/doctrees/environment.pickle and /dev/null differ diff --git a/doc/_build/doctrees/index.doctree b/doc/_build/doctrees/index.doctree deleted file mode 100644 index 09e99d49..00000000 Binary files a/doc/_build/doctrees/index.doctree and /dev/null differ diff --git a/doc/_build/html/.buildinfo b/doc/_build/html/.buildinfo deleted file mode 100644 index 666a5fbb..00000000 --- a/doc/_build/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: c43a9c1bc9ab3e4c662332b15085c411 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/doc/_build/html/_sources/index.txt b/doc/_build/html/_sources/index.txt deleted file mode 100644 index db13599a..00000000 --- a/doc/_build/html/_sources/index.txt +++ /dev/null @@ -1,79 +0,0 @@ -.. python-twitter documentation master file, created by - sphinx-quickstart on Fri Aug 30 14:37:05 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to python-twitter's documentation! -========================================== -**A Python wrapper around the Twitter API.** - -Author: The Python-Twitter Developers - -Introduction ------------- -This library provides a pure Python interface for the `Twitter API `_. It works with Python versions from 2.5 to 2.7. Python 3 support is under development. - -`Twitter `_ provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a `web services API `_ and this library is intended to make it even easier for Python programmers to use. - - -Building --------- -From source: - -Install the dependencies: - -- `SimpleJson `_ -- `Requests OAuthlib `_ -- `HTTPLib2 `_ - -This branch is currently in development to replace the OAuth and HTTPLib2 libarays with the following: - -- `Requests `_ - - -Alternatively use `pip`:: - - $ pip install -r requirements.txt - -Download the latest `python-twitter` library from: http://code.google.com/p/python-twitter/ - -Extract the source distribution and run:: - - $ python setup.py build - $ python setup.py install - - -Testing -------- -With setuptools installed:: - - $ python setup.py test - - -Without setuptools installed:: - - $ python twitter_test.py - - -Getting the code ----------------- -The code is hosted at `Github `_. - -Check out the latest development version anonymously with:: - -$ git clone git://github.com/bear/python-twitter.git -$ cd python-twitter - - -.. toctree:: - :maxdepth: 2 - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/doc/_build/html/_static/ajax-loader.gif b/doc/_build/html/_static/ajax-loader.gif deleted file mode 100644 index 61faf8ca..00000000 Binary files a/doc/_build/html/_static/ajax-loader.gif and /dev/null differ diff --git a/doc/_build/html/_static/basic.css b/doc/_build/html/_static/basic.css deleted file mode 100644 index c959cf0d..00000000 --- a/doc/_build/html/_static/basic.css +++ /dev/null @@ -1,537 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -div.sphinxsidebar #searchbox input[type="submit"] { - width: 30px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/doc/_build/html/_static/comment-bright.png b/doc/_build/html/_static/comment-bright.png deleted file mode 100644 index 551517b8..00000000 Binary files a/doc/_build/html/_static/comment-bright.png and /dev/null differ diff --git a/doc/_build/html/_static/comment-close.png b/doc/_build/html/_static/comment-close.png deleted file mode 100644 index 09b54be4..00000000 Binary files a/doc/_build/html/_static/comment-close.png and /dev/null differ diff --git a/doc/_build/html/_static/comment.png b/doc/_build/html/_static/comment.png deleted file mode 100644 index 92feb52b..00000000 Binary files a/doc/_build/html/_static/comment.png and /dev/null differ diff --git a/doc/_build/html/_static/default.css b/doc/_build/html/_static/default.css deleted file mode 100644 index e534a078..00000000 --- a/doc/_build/html/_static/default.css +++ /dev/null @@ -1,256 +0,0 @@ -/* - * default.css_t - * ~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- default theme. - * - * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: sans-serif; - font-size: 100%; - background-color: #11303d; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - background-color: #1c4e63; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: #ffffff; - color: #000000; - padding: 0 20px 30px 20px; -} - -div.footer { - color: #ffffff; - width: 100%; - padding: 9px 0 9px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #ffffff; - text-decoration: underline; -} - -div.related { - background-color: #133f52; - line-height: 30px; - color: #ffffff; -} - -div.related a { - color: #ffffff; -} - -div.sphinxsidebar { -} - -div.sphinxsidebar h3 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.4em; - font-weight: normal; - margin: 0; - padding: 0; -} - -div.sphinxsidebar h3 a { - color: #ffffff; -} - -div.sphinxsidebar h4 { - font-family: 'Trebuchet MS', sans-serif; - color: #ffffff; - font-size: 1.3em; - font-weight: normal; - margin: 5px 0 0 0; - padding: 0; -} - -div.sphinxsidebar p { - color: #ffffff; -} - -div.sphinxsidebar p.topless { - margin: 5px 10px 10px 10px; -} - -div.sphinxsidebar ul { - margin: 10px; - padding: 0; - color: #ffffff; -} - -div.sphinxsidebar a { - color: #98dbcc; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - - - -/* -- hyperlink styles ------------------------------------------------------ */ - -a { - color: #355f7c; - text-decoration: none; -} - -a:visited { - color: #355f7c; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - - - -/* -- body styles ----------------------------------------------------------- */ - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Trebuchet MS', sans-serif; - background-color: #f2f2f2; - font-weight: normal; - color: #20435c; - border-bottom: 1px solid #ccc; - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; } -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.admonition p { - margin-bottom: 5px; -} - -div.admonition pre { - margin-bottom: 5px; -} - -div.admonition ul, div.admonition ol { - margin-bottom: 5px; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 5px; - background-color: #eeffcc; - color: #333333; - line-height: 120%; - border: 1px solid #ac9; - border-left: none; - border-right: none; -} - -tt { - background-color: #ecf0f3; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -th { - background-color: #ede; -} - -.warning tt { - background: #efc2c2; -} - -.note tt { - background: #d6d6d6; -} - -.viewcode-back { - font-family: sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} \ No newline at end of file diff --git a/doc/_build/html/_static/doctools.js b/doc/_build/html/_static/doctools.js deleted file mode 100644 index 2036e5f5..00000000 --- a/doc/_build/html/_static/doctools.js +++ /dev/null @@ -1,238 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/doc/_build/html/_static/down-pressed.png b/doc/_build/html/_static/down-pressed.png deleted file mode 100644 index 6f7ad782..00000000 Binary files a/doc/_build/html/_static/down-pressed.png and /dev/null differ diff --git a/doc/_build/html/_static/down.png b/doc/_build/html/_static/down.png deleted file mode 100644 index 3003a887..00000000 Binary files a/doc/_build/html/_static/down.png and /dev/null differ diff --git a/doc/_build/html/_static/file.png b/doc/_build/html/_static/file.png deleted file mode 100644 index d18082e3..00000000 Binary files a/doc/_build/html/_static/file.png and /dev/null differ diff --git a/doc/_build/html/_static/jquery.js b/doc/_build/html/_static/jquery.js deleted file mode 100644 index 83589daa..00000000 --- a/doc/_build/html/_static/jquery.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v1.8.3 jquery.com | jquery.org/license */ -(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
t
",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
","
"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/doc/_build/html/_static/minus.png b/doc/_build/html/_static/minus.png deleted file mode 100644 index da1c5620..00000000 Binary files a/doc/_build/html/_static/minus.png and /dev/null differ diff --git a/doc/_build/html/_static/plus.png b/doc/_build/html/_static/plus.png deleted file mode 100644 index b3cb3742..00000000 Binary files a/doc/_build/html/_static/plus.png and /dev/null differ diff --git a/doc/_build/html/_static/pygments.css b/doc/_build/html/_static/pygments.css deleted file mode 100644 index d79caa15..00000000 --- a/doc/_build/html/_static/pygments.css +++ /dev/null @@ -1,62 +0,0 @@ -.highlight .hll { background-color: #ffffcc } -.highlight { background: #eeffcc; } -.highlight .c { color: #408090; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #007020 } /* Comment.Preproc */ -.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #333333 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0044DD } /* Generic.Traceback */ -.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #007020 } /* Keyword.Pseudo */ -.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #902000 } /* Keyword.Type */ -.highlight .m { color: #208050 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ -.highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ -.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ -.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #208050 } /* Literal.Number.Float */ -.highlight .mh { color: #208050 } /* Literal.Number.Hex */ -.highlight .mi { color: #208050 } /* Literal.Number.Integer */ -.highlight .mo { color: #208050 } /* Literal.Number.Oct */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ -.highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ -.highlight .ss { color: #517918 } /* Literal.String.Symbol */ -.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/doc/_build/html/_static/searchtools.js b/doc/_build/html/_static/searchtools.js deleted file mode 100644 index f5c7e5fe..00000000 --- a/doc/_build/html/_static/searchtools.js +++ /dev/null @@ -1,622 +0,0 @@ -/* - * searchtools.js_t - * ~~~~~~~~~~~~~~~~ - * - * Sphinx JavaScript utilties for the full-text search. - * - * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - - -/** - * Porter Stemmer - */ -var Stemmer = function() { - - var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' - }; - - var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' - }; - - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence - - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem - - this.stemWord = function (w) { - var stem; - var suffix; - var firstch; - var origword = w; - - if (w.length < 3) - return w; - - var re; - var re2; - var re3; - var re4; - - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); - - // Step 1a - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); - - // Step 1b - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - var fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re,""); - } - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; - else if (re3.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; - } - } - - // Step 1c - re = /^(.+?)y$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; - } - - // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; - } - - // Step 3 - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; - } - - // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; - } - - // Step 5 - re = /^(.+?)e$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; - } - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - - // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); - return w; - } -} - - - -/** - * Simple result scoring code. - */ -var Scorer = { - // Implement the following function to further tweak the score for each result - // The function takes a result array [filename, title, anchor, descr, score] - // and returns the new score. - /* - score: function(result) { - return result[4]; - }, - */ - - // query matches the full name of an object - objNameMatch: 11, - // or matches in the last dotted part of the object name - objPartialMatch: 6, - // Additive scores depending on the priority of the object - objPrio: {0: 15, // used to be importantResults - 1: 5, // used to be objectResults - 2: -5}, // used to be unimportantResults - // Used when the priority is not in the mapping. - objPrioDefault: 0, - - // query found in title - title: 15, - // query found in terms - term: 5 -}; - - -/** - * Search Module - */ -var Search = { - - _index : null, - _queued_query : null, - _pulse_status : -1, - - init : function() { - var params = $.getQueryParameters(); - if (params.q) { - var query = params.q[0]; - $('input[name="q"]')[0].value = query; - this.performSearch(query); - } - }, - - loadIndex : function(url) { - $.ajax({type: "GET", url: url, data: null, - dataType: "script", cache: true, - complete: function(jqxhr, textstatus) { - if (textstatus != "success") { - document.getElementById("searchindexloader").src = url; - } - }}); - }, - - setIndex : function(index) { - var q; - this._index = index; - if ((q = this._queued_query) !== null) { - this._queued_query = null; - Search.query(q); - } - }, - - hasIndex : function() { - return this._index !== null; - }, - - deferQuery : function(query) { - this._queued_query = query; - }, - - stopPulse : function() { - this._pulse_status = 0; - }, - - startPulse : function() { - if (this._pulse_status >= 0) - return; - function pulse() { - var i; - Search._pulse_status = (Search._pulse_status + 1) % 4; - var dotString = ''; - for (i = 0; i < Search._pulse_status; i++) - dotString += '.'; - Search.dots.text(dotString); - if (Search._pulse_status > -1) - window.setTimeout(pulse, 500); - } - pulse(); - }, - - /** - * perform a search for something (or wait until index is loaded) - */ - performSearch : function(query) { - // create the required interface elements - this.out = $('#search-results'); - this.title = $('

' + _('Searching') + '

').appendTo(this.out); - this.dots = $('').appendTo(this.title); - this.status = $('

').appendTo(this.out); - this.output = $('
'); - } - // Prettify the comment rating. - comment.pretty_rating = comment.rating + ' point' + - (comment.rating == 1 ? '' : 's'); - // Make a class (for displaying not yet moderated comments differently) - comment.css_class = comment.displayed ? '' : ' moderate'; - // Create a div for this comment. - var context = $.extend({}, opts, comment); - var div = $(renderTemplate(commentTemplate, context)); - - // If the user has voted on this comment, highlight the correct arrow. - if (comment.vote) { - var direction = (comment.vote == 1) ? 'u' : 'd'; - div.find('#' + direction + 'v' + comment.id).hide(); - div.find('#' + direction + 'u' + comment.id).show(); - } - - if (opts.moderator || comment.text != '[deleted]') { - div.find('a.reply').show(); - if (comment.proposal_diff) - div.find('#sp' + comment.id).show(); - if (opts.moderator && !comment.displayed) - div.find('#cm' + comment.id).show(); - if (opts.moderator || (opts.username == comment.username)) - div.find('#dc' + comment.id).show(); - } - return div; - } - - /** - * A simple template renderer. Placeholders such as <%id%> are replaced - * by context['id'] with items being escaped. Placeholders such as <#id#> - * are not escaped. - */ - function renderTemplate(template, context) { - var esc = $(document.createElement('div')); - - function handle(ph, escape) { - var cur = context; - $.each(ph.split('.'), function() { - cur = cur[this]; - }); - return escape ? esc.text(cur || "").html() : cur; - } - - return template.replace(/<([%#])([\w\.]*)\1>/g, function() { - return handle(arguments[2], arguments[1] == '%' ? true : false); - }); - } - - /** Flash an error message briefly. */ - function showError(message) { - $(document.createElement('div')).attr({'class': 'popup-error'}) - .append($(document.createElement('div')) - .attr({'class': 'error-message'}).text(message)) - .appendTo('body') - .fadeIn("slow") - .delay(2000) - .fadeOut("slow"); - } - - /** Add a link the user uses to open the comments popup. */ - $.fn.comment = function() { - return this.each(function() { - var id = $(this).attr('id').substring(1); - var count = COMMENT_METADATA[id]; - var title = count + ' comment' + (count == 1 ? '' : 's'); - var image = count > 0 ? opts.commentBrightImage : opts.commentImage; - var addcls = count == 0 ? ' nocomment' : ''; - $(this) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-open' + addcls, - id: 'ao' + id - }) - .append($(document.createElement('img')).attr({ - src: image, - alt: 'comment', - title: title - })) - .click(function(event) { - event.preventDefault(); - show($(this).attr('id').substring(2)); - }) - ) - .append( - $(document.createElement('a')).attr({ - href: '#', - 'class': 'sphinx-comment-close hidden', - id: 'ah' + id - }) - .append($(document.createElement('img')).attr({ - src: opts.closeCommentImage, - alt: 'close', - title: 'close' - })) - .click(function(event) { - event.preventDefault(); - hide($(this).attr('id').substring(2)); - }) - ); - }); - }; - - var opts = { - processVoteURL: '/_process_vote', - addCommentURL: '/_add_comment', - getCommentsURL: '/_get_comments', - acceptCommentURL: '/_accept_comment', - deleteCommentURL: '/_delete_comment', - commentImage: '/static/_static/comment.png', - closeCommentImage: '/static/_static/comment-close.png', - loadingImage: '/static/_static/ajax-loader.gif', - commentBrightImage: '/static/_static/comment-bright.png', - upArrow: '/static/_static/up.png', - downArrow: '/static/_static/down.png', - upArrowPressed: '/static/_static/up-pressed.png', - downArrowPressed: '/static/_static/down-pressed.png', - voting: false, - moderator: false - }; - - if (typeof COMMENT_OPTIONS != "undefined") { - opts = jQuery.extend(opts, COMMENT_OPTIONS); - } - - var popupTemplate = '\ -
\ -

\ - Sort by:\ - best rated\ - newest\ - oldest\ -

\ -
Comments
\ -
\ - loading comments...
\ -
    \ -
    \ -

    Add a comment\ - (markup):

    \ -
    \ - reStructured text markup: *emph*, **strong**, \ - ``code``, \ - code blocks: :: and an indented block after blank line
    \ -
    \ - \ -

    \ - \ - Propose a change ▹\ - \ - \ - Propose a change ▿\ - \ -

    \ - \ - \ - \ - \ - \ -
    \ -
    '; - - var commentTemplate = '\ -
    \ -
    \ -
    \ - \ - \ - \ - \ - \ - \ -
    \ -
    \ - \ - \ - \ - \ - \ - \ -
    \ -
    \ -
    \ -

    \ - <%username%>\ - <%pretty_rating%>\ - <%time.delta%>\ -

    \ -
    <#text#>
    \ -

    \ - \ - reply ▿\ - proposal ▹\ - proposal ▿\ - \ - \ -

    \ -
    \
    -<#proposal_diff#>\
    -        
    \ -
      \ -
      \ -
      \ -
      \ - '; - - var replyTemplate = '\ -
    • \ -
      \ -
      \ - \ - \ - \ - \ - \ - \ -
      \ -
    • '; - - $(document).ready(function() { - init(); - }); -})(jQuery); - -$(document).ready(function() { - // add comment anchors for all paragraphs that are commentable - $('.sphinx-has-comment').comment(); - - // highlight search words in search results - $("div.context").each(function() { - var params = $.getQueryParameters(); - var terms = (params.q) ? params.q[0].split(/\s+/) : []; - var result = $(this); - $.each(terms, function() { - result.highlightText(this.toLowerCase(), 'highlighted'); - }); - }); - - // directly open comment window if requested - var anchor = document.location.hash; - if (anchor.substring(0, 9) == '#comment-') { - $('#ao' + anchor.substring(9)).click(); - document.location.hash = '#s' + anchor.substring(9); - } -}); diff --git a/doc/_build/html/genindex.html b/doc/_build/html/genindex.html deleted file mode 100644 index 053f655a..00000000 --- a/doc/_build/html/genindex.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - Index — python-twitter 1.0 documentation - - - - - - - - - - - - - -
      -
      -
      -
      - - -

      Index

      - -
      - -
      - - -
      -
      -
      -
      -
      - - - - - -
      -
      -
      -
      - - - - \ No newline at end of file diff --git a/doc/_build/html/index.html b/doc/_build/html/index.html deleted file mode 100644 index 5c90eaf8..00000000 --- a/doc/_build/html/index.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - Welcome to python-twitter’s documentation! — python-twitter 1.0 documentation - - - - - - - - - - - - - -
      -
      -
      -
      - -
      -

      Welcome to python-twitter’s documentation!

      -

      A Python wrapper around the Twitter API.

      -

      Author: The Python-Twitter Developers <python-twitter@googlegroups.com>

      -
      -

      Introduction

      -

      This library provides a pure Python interface for the Twitter API. It works with Python versions from 2.5 to 2.7. Python 3 support is under development.

      -

      Twitter provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a web services API and this library is intended to make it even easier for Python programmers to use.

      -
      -
      -

      Building

      -

      From source:

      -

      Install the dependencies:

      - -

      This branch is currently in development to replace the OAuth and HTTPLib2 libarays with the following:

      - -

      Alternatively use pip:

      -
      $ pip install -r requirements.txt
      -
      -
      -

      Download the latest python-twitter library from: http://code.google.com/p/python-twitter/

      -

      Extract the source distribution and run:

      -
      $ python setup.py build
      -$ python setup.py install
      -
      -
      -
      -
      -

      Testing

      -

      With setuptools installed:

      -
      $ python setup.py test
      -
      -
      -

      Without setuptools installed:

      -
      $ python twitter_test.py
      -
      -
      -
      -
      -

      Getting the code

      -

      The code is hosted at Github.

      -

      Check out the latest development version anonymously with:

      -
      $ git clone git://github.com/bear/python-twitter.git
      -$ cd python-twitter
      -
      -
      -
      -
        -
      -
      -
      -
      -
      -

      Indices and tables

      - -
      - - -
      -
      -
      -
      -
      -

      Table Of Contents

      - - -

      This Page

      - - - -
      -
      -
      -
      - - - - \ No newline at end of file diff --git a/doc/_build/html/objects.inv b/doc/_build/html/objects.inv deleted file mode 100644 index 1fa30d71..00000000 Binary files a/doc/_build/html/objects.inv and /dev/null differ diff --git a/doc/_build/html/search.html b/doc/_build/html/search.html deleted file mode 100644 index cb5a6c8d..00000000 --- a/doc/_build/html/search.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - Search — python-twitter 1.0 documentation - - - - - - - - - - - - - - - - - - - -
      -
      -
      -
      - -

      Search

      -
      - -

      - Please activate JavaScript to enable the search - functionality. -

      -
      -

      - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. -

      -
      - - - - - -
      - -
      - -
      -
      -
      -
      -
      -
      -
      -
      -
      - - - - \ No newline at end of file diff --git a/doc/_build/html/searchindex.js b/doc/_build/html/searchindex.js deleted file mode 100644 index 46e57540..00000000 --- a/doc/_build/html/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({envversion:42,terms:{code:[],replac:0,modul:0,request:0,download:0,api:0,connect:0,cheeseshop:[],pip:0,instal:0,txt:0,extract:0,check:0,librari:0,out:0,even:0,index:0,oauthlib:0,git:0,from:0,googl:0,expos:0,author:0,oauth:0,support:0,develop:0,depend:0,wrapper:0,latest:0,current:0,web:0,run:0,version:0,interfac:0,build:[],pure:0,under:0,test:[],you:[],content:[],intend:0,easier:0,altern:0,simplegeo:[],setup:0,sourc:0,http:0,around:0,simplejson:0,get:[],googlegroup:0,clone:0,setuptool:0,bear:0,pypi:[],thi:0,host:0,oauth2:[],libarai:0,branch:0,twitter_test:0,org:[],along:[],peopl:0,introduct:[],search:0,github:0,via:0,doc:[],servic:0,work:0,requir:0,dev:[],page:0,provid:0,without:0,follow:0,allow:0,distribut:0,programm:0,anonym:0,readthedoc:[],com:0,make:0,httplib2:0},objtypes:{},objnames:{},filenames:["index"],titles:["Welcome to python-twitter’s documentation!"],objects:{},titleterms:{code:0,welcom:0,get:0,python:0,twitter:0,indic:0,build:0,tabl:0,test:0,document:0,introduct:0}}) \ No newline at end of file diff --git a/doc/changelog.rst b/doc/changelog.rst new file mode 100644 index 00000000..18050c6e --- /dev/null +++ b/doc/changelog.rst @@ -0,0 +1,166 @@ +Changelog +--------- + +Version 3.4.2 +============= + +Bugfixes: + +* Allow upload of GIFs with size up to 15mb. See `#538 `_ + +Version 3.4.1 +============= + +Bugfixes: + +* Fix an issue where :py:func:`twitter.twitter_utils.calc_expected_status_length` was failing for python 2 due to a failure to convert a bytes string to unicode. `Github issue #546 `_. + +* Documentation fix for :py:func:`twitter.api.Api.UsersLookup`. UsersLookup can take a string or a list and properly parses both of them now. Github issues `#535 `_ and `#549 `_. + +* Properly decode response content for :py:func:`twitter.twitter_utils.http_to_file`. `Github issue #521 `_. + +* Fix an issue with loading extended_tweet entities from Streaming API where tweets would be truncated when converting to a :py:class:`twitter.models.Status`. Github issues `#491 `_ and `#506 `_. + +Version 3.4 +=========== + +Deprecations +++++++++++++ + +* :py:func:`twitter.api.Api.UpdateBackgroundImage`. Please make sure that your code does not call this function as it will now return a hard error. There is no replacement function. This was deprecated by Twitter around July 2015. + +* :py:func:`twitter.api.Api.PostMedia` has been removed. Please use :py:func:`twitter.api.Api.PostUpdate` instead. + +* :py:func:`twitter.api.Api.PostMultipleMedia`. Please use :py:func:`twitter.api.Api.PostUpdate` instead. + + +Version 3.3.1 +============= + +* Adds support for 280 character limit. + + +Version 3.3 +============= + +* Adds application only authentication. See `Twitter's documentation for details `_. To use application only authentication, pass `application_only_auth` when creating the Api; the bearer token will be automatically retrieved. + +* Adds function :py:func:`twitter.api.GetAppOnlyAuthToken` + +* Adds `filter_level` keyword argument for :py:func:`twitter.api.GetStreamFilter`, :py:func:`twitter.api.GetUserStream` + +* Adds `proxies` keyword argument for creating an Api instance. Pass a dictionary of proxies for the request to pass through, if not specified allows requests lib to use environmental variables for proxy if any. + +* Adds support for `quoted_status` to the :py:class:`twitter.models.Status` model. + + +Version 3.2.1 +============= + +* :py:func:`twitter.twitter_utils.calc_expected_status_length` should now function properly. Previously, URLs would be counted incorrectly. See `PR #416 `_ + +* :py:func:`twitter.api.Api.PostUpdates` now passes any keyword arguments on the edge case that only one tweet was actually being posted. + + +Version 3.2 +=========== + +Deprecations +++++++++++++ + +Nothing is being deprecationed this version, however here's what's being deprecated as of v. 3.3.0: + +* :py:func:`twitter.api.Api.UpdateBackgroundImage`. Please make sure that your code does not call this function as it will be returning a hard error. There is no replace function. This was deprecated by Twitter around July 2015. + +* :py:func:`twitter.api.Api.PostMedia` will be removed. Please use :py:func:`twitter.api.Api.PostUpdate` instead. + +* :py:func:`twitter.api.Api.PostMultipleMedia`. Please use :py:func:`twitter.api.Api.PostUpdate` instead. + +* :py:func:`twitter.api.GetFriends` will no longer accept a `cursor` or `count` parameter. Please use :py:func:`twitter.api.GetFriendsPaged` instead. + +* :py:func:`twitter.api.GetFollowers` will no longer accept a `cursor` or `count` parameter. Please use :py:func:`twitter.api.GetFollowersPaged` instead. + + +What's New +++++++++++ + +* We've added new deprecation warnings, so it's easier to track when things go away. All of python-twitter's deprecation warnings will be a subclass of :py:class:`twitter.error.PythonTwitterDeprecationWarning` and will have a version number associated with them such as :py:class:`twitter.error.PythonTwitterDeprecationWarning330`. + + +* :py:class:`twitter.models.User` now contains a ``following`` attribute, which describes whether the authenticated user is following the User. `PR #351 `_ + +* :py:class:`twitter.models.DirectMessage` contains a full :py:class:`twitter.models.User` object for both the ``DirectMessage.sender`` and ``DirectMessage.recipient`` properties. `PR #384 `_. + +* You can now upload Quicktime movies (``*.mov``). `PR #372 `_. + +* If you have a whitelisted app, you can now get the authenticated user's email address through a call to :py:func:`twitter.api.Api.VerifyCredentials()`. If your app isn't whitelisted, no error is returned. `PR #376 `_. + +* Google App Engine support has been reintegrated into the library. Check out `PR #383 `_. + +* `video_info` is now available on a `twitter.models.Media` object, which allows access to video urls/bitrates/etc. in the `extended_entities` node of a tweet. + +What's Changed +++++++++++++++ + +* :py:class:`twitter.models.Trend`'s `volume` attribute has been renamed `tweet_volume` in line with Twitter's naming convention. This change should allow users to access the number of tweets being tweeted for a given Trend. `PR #375 `_ + +* :py:class:`twitter.ratelimit.RateLimit` should behave better now and adds a 1-second padding to requests after sleeping. + +* :py:class:`twitter.ratelimit.RateLimit` now keeps track of your rate limit status even if you don't have ``sleep_on_rate_limit`` set to ``True`` when instatiating the API. If you want to add different behavior on hitting a rate limit, you should be able to now by querying the rate limit object. See `PR #370 `_ for the technical details of the change. There should be no difference in behavior for the defaults, but let us know. + + +Bugfixes +++++++++ + +* :py:class:`twitter.models.Media` again contains a ``sizes`` attribute, which was missed back in the Version 3.0 release. `PR #360 `_ + +* The previously bloated :py:func:`twitter.api.Api.UploadMediaChunked()` function has been broken out into three related functions and fixes two an incompatibility with python 2.7. Behavior remains the same, but this should simplify matters. `PR #347 `_ + +* Fix for :py:func:`twitter.api.Api.PostUpdate()` where a passing an integer to the ``media`` parameter would cause an iteration error to occur. `PR #347 `_ + +* Fix for 401 errors that were occuring in the Streaming Endpoints. `PR #364 `_ + + + +Version 3.1 +========== + +What's New +++++++++++ + +* :py:func:`twitter.api.Api.PostMediaMetadata()` Method allows the posting of alt text (hover text) to a photo on Twitter. Note that it appears that you have to call this method prior to attaching the photo to a status. + +* A couple new methods have been added related to showing the connections between two users: + + * :py:func:`twitter.api.Api.ShowFriendship()` shows the connection between two users (i.e., are they following each other?) + * :py:func:`twitter.api.Api.IncomingFriendship()` shows all of the authenticated user's pending follower requests (if the user has set their account to private). + * :py:func:`twitter.api.Api.OutgoingFriendship()` shows the authenticated user's request to follow other users (i.e. the user has attempted to follow a private account). + +* Several methods were added related to muting users: + + * :py:func:`twitter.api.Api.GetMutes()` returns **all** users the currently authenticated user is muting (as ``twitter.models.User`` objects). + * :py:func:`twitter.api.Api.GetMutesPaged()` returns a page of ``twitter.models.User`` objects. + * :py:func:`twitter.api.Api.GetMutesIDs()` returns **all** of the users the currently authenticated user is muting as integers. + * :py:func:`twitter.api.Api.GetMutesIDsPaged()` returns a single page of the users the currently authenticated user is muting as integers. + + +What's Changed +++++++++++++++ + +* :py:func:`twitter.api.Api.GetStatus()` Now accepts the keyword argument ``include_ext_alt_text`` which will request alt text to be included with the Status object being returned (if available). Defaults to ``True``. + +* ``[model].__repr__()`` functions have been revised for better Unicode compatibility. If you notice any weirdness, please let us know. + +* :py:func:`twitter.api.Api()` no longer accepts the ``shortner`` parameter; however, see ``examples/shorten_url.py`` for an example of how to use a URL shortener with the API. + +* :py:func:`twitter.api.Api._Encode()` and :py:func:`twitter.api.Api._EncodePostData()` have both been refactored out of the API. + +* :py:class:`twitter.models.Media` now has an attribute ``ext_alt_text`` for alt (hover) text for images posted to Twitter. + +* :py:class:`twitter.models.Status` no longer has the properties ``relative_created_at``, ``now``, or ``Now``. If you require a relative time, we suggest using a third-party library. + +* Updated examples, specifically ``examples/twitter-to-xhtml.py``, ``examples/view_friends.py``, ``examples/shorten_url.py`` + +* Updated ``get_access_token.py`` script to be python3 compatible. + +* :py:func:`twitter.api.Api.GetStreamFilter()` now accepts an optional languages parameter as a list. diff --git a/doc/changes_to_tweet_counting.rst b/doc/changes_to_tweet_counting.rst new file mode 100644 index 00000000..d1c9b249 --- /dev/null +++ b/doc/changes_to_tweet_counting.rst @@ -0,0 +1,79 @@ +REST API Changes +================= + +Information compiled on Sept 14, 2016. + +``statuses/update`` Endpoint +---------------------------- + +``auto_populate_reply_metadata`` ++++++++++++++++++++++++++++++++ + +* Default is ``false`` + +* Must have ``in_reply_to_status_id`` set. + +* Unknown what happens if not set. Probably error (does it get posted?) + +* If the status to which you're replying is deleted, tweet will fail to post. + +``exclude_reply_user_ids`` +++++++++++++++++++++++++++ + +* List of ``user_ids`` to remove from result of ``auto_populate_reply_metadata``. + +* Doesn't apply to the first ``user_id``. + +* If you try to remove it, this will be silently ignored by Twitter. + +``attachment_url`` +++++++++++++++++++ + +* Must be a status permalnk or a DM deep link. + +* If it's anything else and included in this parameter, Twitter will return an error. + + +Most Other Endpoints +-------------------- + +``tweet_mode`` +++++++++++++++ + +* Any endpoint that returns a tweet will accept this param. + +* Must be in ``['compat', 'extended']`` + +* If ``tweet_mode == 'compat'``, then no ``extended_tweet`` node in the json returned. + +* If ``tweet_mode == 'extended'``, then you'll get the ``extended_tweet`` node. + + +Errors +------ +* 44 -> URL passed to attachment_url is invalid + +* 385 -> Replied to deleted tweet or tweet not visible to you + +* 386 -> Too many attachments types (ie a GIF + quote tweet) + + +Streaming API +============= + +Everything is going to be compatibility mode for now; however **all** tweets with have an ``extended_tweet`` node, which will contain the new information. According to Twitter's documentation though, there's the possibility that this node may not exist. We should be careful about making assumptions here. + + +Changes to Models +================= + +Classic tweet: tweet with length < 140 char. +Extended tweet: tweet with extended entities and text > 140 chars. + +Twitter doesn't say if extended tweet with a total length of < 140 characters will be considered a "Classic tweet". They also state that an extended tweet shall have "text content [that] exceeds 140 characters in length", however this is contradictory to earlier statements about total text length retaining a hard max at 140 characters. + +There will be two rendering modes: Compatibility and Extended. If in compatibility mode and tweet is "classic", no changes to tweet JSON. If in Extended mode, the following will change: + +* ``text`` -> truncated version of the extended tweet's text + "..." + permalink to tweet. (Twitter is mute on whether an extended tweet's with (text + @mentions + urls) < 140 characters will have the @mentions + urls put back in ``text`` field.) + +* ``truncated`` -> gets set to ``True`` if extended tweet is rendered in compat mode. diff --git a/doc/conf.py b/doc/conf.py index d5a0cc05..2121447d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -11,12 +11,16 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys +import os +import shlex + +sys.path.append(os.path.abspath('../')) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- @@ -25,7 +29,12 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage', + 'sphinx.ext.viewcode', + 'sphinx.ext.napoleon' +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -41,16 +50,16 @@ # General information about the project. project = u'python-twitter' -copyright = u'2013, python-twitter@googlegroups.com' +copyright = u'2016, python-twitter@googlegroups.com' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '1.0' +version = '3.4' # The full version, including alpha/beta/rc tags. -release = '1.0' +release = '3.4.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -94,7 +103,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -173,21 +182,21 @@ # -- Options for LaTeX output -------------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'python-twitter.tex', u'python-twitter Documentation', - u'python-twitter@googlegroups.com', 'manual'), + ('index', 'python-twitter.tex', u'python-twitter Documentation', + u'python-twitter@googlegroups.com', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -230,9 +239,9 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'python-twitter', u'python-twitter Documentation', - u'python-twitter@googlegroups.com', 'python-twitter', 'One line description of project.', - 'Miscellaneous'), + ('index', 'python-twitter', u'python-twitter Documentation', + u'python-twitter@googlegroups.com', 'python-twitter', 'One line description of project.', + 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. diff --git a/doc/contributing.rst b/doc/contributing.rst new file mode 100644 index 00000000..8f6f0874 --- /dev/null +++ b/doc/contributing.rst @@ -0,0 +1,37 @@ +Contributing +------------ + +Getting the code +================ + +The code is hosted at `Github `_. + +Check out the latest development version anonymously with:: + + $ git clone git://github.com/bear/python-twitter.git + $ cd python-twitter + +The following sections assuming that you have `pyenv +`_ installed and working on your computer. + +To install dependencies, run:: + + $ make dev + +This will install all of the required packages for the core library, testing, +and installation. + +Testing +======= + +Once you have your development environment set up, you can run:: + + $ make test + +to ensure that all tests are currently passing before starting work. You can +also check test coverage by running:: + + $ make coverage + +Pull requests are welcome or, if you are having trouble, please open an issue on +GitHub. diff --git a/doc/getting_started.rst b/doc/getting_started.rst new file mode 100644 index 00000000..b5044a18 --- /dev/null +++ b/doc/getting_started.rst @@ -0,0 +1,57 @@ +Getting Started +=============== + +Getting your application tokens ++++++++++++++++++++++++++++++++ + +.. danger:: + +This section is subject to changes made by Twitter and may not always be completely up-to-date. If you see something change on their end, please create a `new issue on Github `_ or submit a pull request to update it. + + +In order to use the python-twitter API client, you first need to acquire a set of application tokens. These will be your ``consumer_key`` and ``consumer_secret``, which get passed to ``twitter.Api()`` when starting your application. + +Create your app +________________ + +The first step in doing so is to create a `Twitter App `_. Click the "Create New App" button and fill out the fields on the next page. + + +.. image:: python-twitter-app-creation-part1.png + +If there are any problems with the information on that page, Twitter will complain and you can fix it. (Make sure to get the name correct - it is unclear if you can change this later.) On the next screen, you'll see the application that you created and some information about it: + +Your app +_________ + +Once your app is created, you'll be directed to a new page showing you some information about it. + +.. image:: python-twitter-app-creation-part2-new.png + +Your Keys +_________ + +Click on the "Keys and Access Tokens" tab on the top. + + +.. image:: python-twitter-app-creation-part3-new.png + + +Under the "Access token & access token secret" option, click on the "create" button to generate a new access token and token secret. + +.. image:: python-twitter-app-creation-part3-1-new.png + + +At this point, you can test out your application using the keys under "Your Application Tokens". The ``twitter.Api()`` object can be created as follows:: + + import twitter + api = twitter.Api(consumer_key=, + consumer_secret=, + access_token_key=, + access_token_secret=) + +Note: Make sure to enclose your keys in quotes (ie, api = twitter.Api(consumer_key='1234567', ...) and so on) or you will receive a NameError. + +If you are creating an application for end users/consumers, then you will want them to authorize your application, but that is outside the scope of this document. + +And that should be it! If you need a little more help, check out the `examples on Github `_. If you have an open source application using python-twitter, send us a link and we'll add a link to it here. diff --git a/doc/index.rst b/doc/index.rst index a9b88ed7..11297339 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,7 +1,4 @@ .. python-twitter documentation master file, created by - sphinx-quickstart on Fri Aug 30 14:37:05 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. Welcome to python-twitter's documentation! ========================================== @@ -9,59 +6,29 @@ Welcome to python-twitter's documentation! Author: The Python-Twitter Developers -Introduction ------------- -This library provides a pure Python interface for the `Twitter API `_. It works with Python version 2.6+. Python 3 support is under development. - -`Twitter `_ provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a `web services API `_ and this library is intended to make it even easier for Python programmers to use. - - -Building --------- -From source: - -Install the dependencies: - -- `Requests `_ -- `Requests OAuthlib `_ - -Alternatively use `pip`:: - - $ pip install -r requirements.txt - -Download the latest `python-twitter` library from: http://code.google.com/p/python-twitter/ - -Extract the source distribution and run:: - - $ python setup.py build - $ python setup.py install - -Testing -------- -With setuptools installed:: +Contents: - $ python setup.py test - - -Without setuptools installed:: - - $ python twitter_test.py - - -Getting the code ----------------- -The code is hosted at `Github `_. - -Check out the latest development version anonymously with:: +.. toctree:: + :maxdepth: 1 -$ git clone git://github.com/bear/python-twitter.git -$ cd python-twitter + installation.rst + getting_started.rst + contributing.rst + migration_v30.rst + changelog.rst + rate_limits.rst + models.rst + searching.rst + with_django.rst + twitter.rst -.. toctree:: - :maxdepth: 2 +Introduction +------------ +This library provides a pure Python interface for the `Twitter API `_. It works with Python 2.7+ and Python 3. +`Twitter `_ provides a service that allows people to connect via the web, IM, and SMS. Twitter exposes a `web services API `_ and this library is intended to make it even easier for Python programmers to use. Indices and tables @@ -70,4 +37,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/doc/installation.rst b/doc/installation.rst new file mode 100644 index 00000000..2e64eb6b --- /dev/null +++ b/doc/installation.rst @@ -0,0 +1,51 @@ +Installation & Testing +------------ + +Installation +============ + +**From PyPI** :: + + $ pip install python-twitter + + +**From source** + +Install the dependencies: + +- `Requests `_ +- `Requests OAuthlib `_ + +Alternatively use `pip`:: + + $ pip install -r requirements.txt + +Download the latest `python-twitter` library from: https://github.com/bear/python-twitter/ + +Extract the source distribution and run:: + + $ python setup.py build + $ python setup.py install + + +Testing +======= + +The following requires ``pip install pytest`` and ``pip install pytest-cov``. Run:: + + $ make test + +If you would like to see coverage information:: + + $ make coverage + + +Getting the code +================ + +The code is hosted at `Github `_. + +Check out the latest development version anonymously with:: + +$ git clone git://github.com/bear/python-twitter.git +$ cd python-twitter diff --git a/doc/migration_v30.rst b/doc/migration_v30.rst new file mode 100644 index 00000000..81a80f2f --- /dev/null +++ b/doc/migration_v30.rst @@ -0,0 +1,153 @@ +Migration from v2 to v3 +----------------------- + +Changes to Existing Methods +=========================== + +:py:func:`twitter.api.Api()` +++++++++++++++++++++++++++++ +* ``shortner`` parameter has been removed. Please see `Issue + #298 `_. + +:py:func:`twitter.api.Api.CreateFavorite` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* kwarg param has been changed to ``status_id`` from ``id`` to be consistent + with other method calls and avoid shadowing builtin function ``id``. + +:py:func:`twitter.api.Api.DestroyFavorite` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* kwarg param has been changed to ``status_id`` from ``id`` to be consistent + with other method calls and avoid shadowing builtin function ``id``. + +:py:func:`twitter.api.Api.DestroyBlock` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Kwarg ``id`` has been changed to ``user_id`` in order to avoid shadowing + a builtin and be more descriptive. + +:py:func:`twitter.api.Api.DestroyStatus` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* kwarg ``id`` has been changed to ``status_id`` in keeping with the rest of + the Api and to avoid shadowing a builtin. + +:py:func:`twitter.api.Api.GetBlocks` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Method no longer accepts parameters ``user_id`` or ``screen_name`` as these are not honored by Twitter. The data returned will be for the authenticated user only. +* Parameter ``cursor`` is no longer accepted -- this method will return **all** users being blocked by the currently authenticated user. If you need paging, please use :py:func:`twitter.api.Api.GetBlocksPaged` instead. + +:py:func:`twitter.api.Api.GetFollowers` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Method no longer honors a ``count`` or ``cursor`` parameter. These have been deprecated in favor of making this method explicitly a convenience function to return a list of every ``twitter.User`` who is following the specified or authenticated user. A warning will be raised if ``count`` or ``cursor`` is passed with the expectation that breaking behavior will be introduced in a later version. +* Method now takes an optional parameter of ``total_count``, which limits the number of users to return. If this is not set, the data returned will be all users following the specified user. +* The kwarg ``include_user_entities`` now defaults to ``True``. This was set to ``False`` previously, but would not be included in query parameters sent to Twitter. Without the query parameter in the URL, Twitter would default to returning user_entities, so this change makes this behavior explicit. + +:py:func:`twitter.api.Api.GetFollowersPaged` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* The third value of the tuple returned by this method is now a list of twitter.User objects in accordance with its doc string rather than the raw data from API. +* The kwarg ``include_user_entities`` now defaults to ``True``. This was set to ``False`` previously, but would not be included in query parameters sent to Twitter. Without the query parameter in the URL, Twitter would default to returning user_entities, so this change makes this behavior explicit and consistent with the previously ambiguous behavior. + +:py:func:`twitter.api.Api.GetFriends` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Method no longer honors a ``count`` or ``cursor`` parameter. These have been deprecated in favor of making this method explicitly a convenience function to return a list of every ``twitter.User`` who is followed by the specified or authenticated user. A warning will be raised if ``count`` or ``cursor`` is passed with the expectation that breaking behavior will be introduced in a later version. +* Method now takes an optional parameter of ``total_count``, which limits the number of users to return. If this is not set, the data returned will be all users followed by the specified user. +* The kwarg ``include_user_entities`` now defaults to ``True``. This was set to ``False`` previously, but would not be included in query parameters sent to Twitter. Without the query parameter in the URL, Twitter would default to returning user_entities, so this change makes this behavior explicit. + +:py:func:`twitter.api.Api.GetFriendsPaged` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* The third value of the tuple returned by this method is now a list of twitter.User objects in accordance with its doc string rather than the raw data from API. +* The kwarg ``include_user_entities`` now defaults to ``True``. This was set to ``False`` previously, but would not be included in query parameters sent to Twitter. Without the query parameter in the URL, Twitter would default to returning user_entities, so this change makes this behavior explicit. + +:py:func:`twitter.api.Api.GetListMembers` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* No longer accepts ``cursor`` parameter. If you require granular control over the paging of the twitter.list.List members, please user twitter.api.Api.GetListMembersPaged instead. + +:py:func:`twitter.api.Api.GetStatus` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Kwarg ``id`` has been changed to ``status_id`` in keeping with the rest of + the Api and to avoid shadowing a builtin. + +:py:func:`twitter.api.Api.GetStatusOembed` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Kwarg ``id`` has been changed to ``status_id`` in keeping with the rest of + the Api and to avoid shadowing a builtin. + +:py:func:`twitter.api.Api.GetSearch` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Adds ``raw_query`` method. See :ref:`raw_queries` for more information. + + +:py:func:`twitter.api.Api.GetTrendsWoeid` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Kwarg ``id`` has been changed to ``woeid`` in order to avoid shadowing + a builtin and be more descriptive. + +:py:func:`twitter.api.Api.GetUserStream` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Parameter 'stall_warning' is now 'stall_warnings' in line with GetStreamFilter and Twitter's naming convention. This should now actually return stall warnings, whereas it did not have any effect previously. + +:py:func:`twitter.api.Api.LookupFriendship` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Method will now accept a list for either ``user_id`` or ``screen_name``. The list can contain either ints, strings, or :py:mod:`twitter.user.User` objects for either ``user_id`` or ``screen_name``. +* Return value is a list of :py:mod:`twitter.user.UserStatus` objects. + +:py:func:`twitter.api.Api.PostUpdate` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Now accepts three new parameters: ``media``, ``media_additional_owners``, and ``media_category``. ``media`` can be a URL, a local file, or a file-like object (something with a ``read()`` method), or a list of any combination of the above. +* ``media_additional_owners`` should be a list of user ids representing Twitter users that should be able to use the uploaded media in their tweets. If you pass a list of media, then **additional owners will apply to each object.** If you need more granular control, please use the UploadMedia* methods. +* ``media_category``: Only for use with the AdsAPI. See https://dev.twitter.com/ads/creative/promoted-video-overview if this applies to your application. + +:py:func:`twitter.api.Api.PostRetweet` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Kwarg ``original_id`` has been changed to ``status_id`` in order to avoid shadowing + a builtin and be more descriptive. + +Deprecation +=========== + +:py:func:`twitter.api.Api.PostMedia` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* This endpoint is deprecated by Twitter. Python-twitter will throw a warning about using the method and advise you to use PostUpdate() instead. There is no schedule for when this will be removed from Twitter. + +:py:func:`twitter.api.Api.PostMultipleMedia` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* This method should be replaced by passing a list of media objects (either URLs, local files, or file-like objects) to PostUpdate. You are limited to a maximum of 4 media files per tweet. + + +New Methods +=========== + +:py:func:`twitter.api.Api.GetBlocksIDs` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Returns **all** the users currently blocked by the authenticated user as user IDs. The user IDs will be integers. + +:py:func:`twitter.api.Api.GetBlocksIDsPaged` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Returns one page, specified by the cursor parameter, of the users currently blocked by the authenticated user as user IDs. + +:py:func:`twitter.api.Api.GetBlocksPaged` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Allows you to page through the currently authenticated user's blocked users. Method returns three values: the next cursor, the previous cursor, and a list of ``twitter.User`` instances representing the blocked users. + +:py:func:`twitter.api.Api.GetListMembersPaged` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Allows you to page through a the members of a given twitter.list.List. +* ``cursor`` parameter operates as with other methods, denoting the page of members that you wish to retrieve. +* Returns ``next_cursor``, ``previous_cursor``, and a list containing the users that are members of the given twitter.list.List. + + +:py:func:`twitter.api.Api.GetListsPaged` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Much like :py:func:`twitter.api.Api.GetFriendsPaged` and similar methods, this allows you to retrieve an arbitrary page of :py:mod:`twitter.list.List` for either the currently authenticated user or a user specified by ``user_id`` or ``screen_name``. +* ``cursor`` should be ``-1`` for the first page. +* Returns the ``next_cursor``, ``previous_cursor``, and a list of :py:mod:`twitter.list.List` instances. + +:py:func:`twitter.api.Api.UploadMediaChunked` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* API method allows chunked upload to upload.twitter.com. Similar to Api.PostMedia(), this method can take either a local filename (str), a URL (str), or a file-like object. The image or video type will be determined by ``mimetypes`` (see :py:func:`twitter.twitter_utils.parse_media_file` for details). +* Optionally, you can specify a chunk_size for uploads when instantiating the Api object. This should be given in bytes. The default is 1MB (that is, 1048576 bytes). Any chunk_size given below 16KB will result in a warning: Twitter will return an error if you try to upload more than 999 chunks of data; for example, if you are uploading a 15MB video, then a chunk_size lower than 15729 bytes will result in 1000 APPEND commands being sent to the API, so you'll get an error. 16KB seems like a reasonable lower bound, but if your use case is well-defined, then python-twitter will not enforce this behavior. +* Another thing to take into consideration: if you're working in a RAM-constrained environment, a very large chunk_size will increase your RAM usage when uploading media through this endpoint. +* The return value will be the ``media_id`` of the uploaded file. + +:py:func:`twitter.api.Api.UploadMediaSimple` ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +* Provides the ability to upload a single media file to Twitter without using the ChunkedUpload endpoint. This method should be used on smaller files and reduces the roundtrips from Twitter from three (for UploadMediaChunked) to one. +* Return value is the ``media_id`` of the uploaded file. diff --git a/doc/models.rst b/doc/models.rst new file mode 100644 index 00000000..5e981e8f --- /dev/null +++ b/doc/models.rst @@ -0,0 +1,15 @@ +Models +====== + +Python-twitter provides the following models of the objects returned by the Twitter API: + +* :py:class:`twitter.models.Category` +* :py:class:`twitter.models.DirectMessage` +* :py:class:`twitter.models.Hashtag` +* :py:class:`twitter.models.List` +* :py:class:`twitter.models.Media` +* :py:class:`twitter.models.Status` +* :py:class:`twitter.models.Trend` +* :py:class:`twitter.models.Url` +* :py:class:`twitter.models.User` +* :py:class:`twitter.models.UserStatus` diff --git a/doc/modules.rst b/doc/modules.rst new file mode 100644 index 00000000..aa26b462 --- /dev/null +++ b/doc/modules.rst @@ -0,0 +1,10 @@ +.. _modules: + +Modules +******* + +.. toctree:: + :maxdepth: 4 + + twitter + diff --git a/doc/python-twitter-app-creation-part1.png b/doc/python-twitter-app-creation-part1.png new file mode 100644 index 00000000..1686de68 Binary files /dev/null and b/doc/python-twitter-app-creation-part1.png differ diff --git a/doc/python-twitter-app-creation-part2-new.png b/doc/python-twitter-app-creation-part2-new.png new file mode 100644 index 00000000..f88e18b7 Binary files /dev/null and b/doc/python-twitter-app-creation-part2-new.png differ diff --git a/doc/python-twitter-app-creation-part2.png b/doc/python-twitter-app-creation-part2.png new file mode 100644 index 00000000..9ab561fc Binary files /dev/null and b/doc/python-twitter-app-creation-part2.png differ diff --git a/doc/python-twitter-app-creation-part3-1-new.png b/doc/python-twitter-app-creation-part3-1-new.png new file mode 100644 index 00000000..3de5bf44 Binary files /dev/null and b/doc/python-twitter-app-creation-part3-1-new.png differ diff --git a/doc/python-twitter-app-creation-part3-new.png b/doc/python-twitter-app-creation-part3-new.png new file mode 100644 index 00000000..739d6162 Binary files /dev/null and b/doc/python-twitter-app-creation-part3-new.png differ diff --git a/doc/python-twitter-app-creation-part3.png b/doc/python-twitter-app-creation-part3.png new file mode 100644 index 00000000..9c29b360 Binary files /dev/null and b/doc/python-twitter-app-creation-part3.png differ diff --git a/doc/rate_limits.rst b/doc/rate_limits.rst new file mode 100644 index 00000000..c6e3cf67 --- /dev/null +++ b/doc/rate_limits.rst @@ -0,0 +1,83 @@ +Rate Limiting +------------- + +Overview +++++++++ + +Twitter imposes rate limiting based either on user tokens or application +tokens. Please see: `API Rate Limits +`_ for a more detailed +explanation of Twitter's policies. What follows will be a summary of how Python-Twitter attempts to +deal with rate limits and how you should expect those limits to be respected +(or not). + + +Python-Twitter tries to abstract away the details of Twitter's rate limiting by +allowing you to globally respect those limits or ignore them. If you wish to +have the application sleep when it hits a rate limit, you should instantiate +the API with ``sleep_on_rate_limit=True`` like so:: + + import twitter + api = twitter.Api(consumer_key=[consumer key], + consumer_secret=[consumer secret], + access_token_key=[access token], + access_token_secret=[access token secret], + sleep_on_rate_limit=True) + +**By default, python-twitter will raise a hard error for rate limits** + +Effectively, when the API determines that the **next** call to an endpoint will +result in a rate limit error being thrown by Twitter, it will sleep until you +are able to safely make that call. For most API methods, the headers in the +response from Twitter will contain the following information: + + ``x-rate-limit-limit``: The number of times you can request the given + endpoint within a certain number of minutes (otherwise known as a window). + + ``x-rate-limit-remaining``: The number of times you have left for a given endpoint within a window. + + ``x-rate-limit-reset``: The number of seconds left until the window resets. + +For most endpoints, this is 15 requests per 15 minutes. So if you have set the +global ``sleep_on_rate_limit`` to ``True``, the process looks something like this:: + + api.GetListMembersPaged() + # GET /list/{id}/members.json?cursor=-1 + # GET /list/{id}/members.json?cursor=2 + # GET /list/{id}/members.json?cursor=3 + # GET /list/{id}/members.json?cursor=4 + # GET /list/{id}/members.json?cursor=5 + # GET /list/{id}/members.json?cursor=6 + # GET /list/{id}/members.json?cursor=7 + # GET /list/{id}/members.json?cursor=8 + # GET /list/{id}/members.json?cursor=9 + # GET /list/{id}/members.json?cursor=10 + # GET /list/{id}/members.json?cursor=11 + # GET /list/{id}/members.json?cursor=12 + # GET /list/{id}/members.json?cursor=13 + # GET /list/{id}/members.json?cursor=14 + + # This last GET request returns a response where x-rate-limit-remaining + # is equal to 0, so the API sleeps for 15 minutes + + # GET /list/{id}/members.json?cursor=15 + + # ... etc ... + +If you would rather not have your API instance sleep when hitting, then do not +pass ``sleep_on_rate_limit=True`` to your API instance. This will cause the API +to raise a hard error when attempting to make call #15 above. + +Technical ++++++++++ + +The ``twitter/ratelimit.py`` file contains the code that handles storing and +checking rate limits for endpoints. Since Twitter does not send any information +regarding the endpoint that you are requesting with the ``x-rate-limit-*`` +headers, the endpoint is determined by some regex using the URL. + +The twitter.Api instance contains an ``Api.rate_limit`` object that you can inspect +to see the current limits for any URL and exposes a number of methods for +querying and setting rate limits on a per-resource (i.e., endpoint) basis. See +:py:func:`twitter.ratelimit.RateLimit` for more information. + diff --git a/doc/searching.rst b/doc/searching.rst new file mode 100644 index 00000000..b569dc5e --- /dev/null +++ b/doc/searching.rst @@ -0,0 +1,19 @@ +.. _searching: + +Searching ++++++++++ + + +.. _raw_queries: + +Raw Queries +=========== + +To the ``Api.GetSearch()`` method, you can pass the parameter ``raw_query``, which should be the query string you wish to use for the search **omitting the leading "?"**. This will override every other parameter. Twitter's search parameters are quite complex, so if you have a need for a very particular search, you can find Twitter's documentation at https://dev.twitter.com/rest/public/search. + +For example, if you want to search for only tweets containing the word "twitter", then you could do the following: :: + + results = api.GetSearch( + raw_query="q=twitter%20&result_type=recent&since=2014-07-19&count=100") + +If you want to build a search query and you're not quite sure how it should look all put together, you can use Twitter's Advanced Search tool: https://twitter.com/search-advanced, and then use the part of search URL after the "?" to use for the Api, removing the ``&src=typd`` portion. diff --git a/doc/twitter.html b/doc/twitter.html index 2217c454..9218cb80 100644 --- a/doc/twitter.html +++ b/doc/twitter.html @@ -1,1966 +1,3080 @@ -Python: module twitter - + +Python: module twitter + +
      - -
       
      - 
      twitter (version 0.8)
      index
      twitter.py
      -

      A library that provides a Python interface to the Twitter API

      + +  
      +  
      twitter + (version 0.8)
      + index
      twitter.py
      + + +

      + A library that provides a Python interface to the Twitter API +

      +

      - - - - -
       
      -Modules
             
      StringIO
      -base64
      -calendar
      -datetime
      -gzip
      -
      httplib
      -oauth2
      -os
      -rfc822
      -json
      -
      sys
      -tempfile
      -textwrap
      -time
      -urllib
      -
      urllib2
      -urlparse
      -

      - - - - - - + + + + + + + + +
       
      -Classes
             
      -
      __builtin__.object -
      -
      -
      Api -
      DirectMessage -
      Hashtag -
      List -
      Status -
      Trend -
      Url -
      User -
      -
      -
      exceptions.Exception(exceptions.BaseException) -
      -
      -
      TwitterError -
      -
      -
      -

      - - - - - - - -
       
      -class Api(__builtin__.object)
         A python interface into the Twitter API

      -By default, the Api caches results for 1 minute.

      -Example usage:

      -  To create an instance of the twitter.Api class, with no authentication:

      -    >>> import twitter
      -    >>> api = twitter.Api()

      -  To fetch a single user's public status messages, where "user" is either
      -  a Twitter "short name" or their user id.

      -    >>> statuses = api.GetUserTimeline(user)
      -    >>> print [s.text for s in statuses]

      -  To use authentication, instantiate the twitter.Api class with a
      -  consumer key and secret; and the oAuth key and secret:

      -    >>> api = twitter.Api(consumer_key='twitter consumer key',
      -                          consumer_secret='twitter consumer secret',
      -                          access_token_key='the_key_given',
      -                          access_token_secret='the_key_secret')

      -  To fetch your friends (after being authenticated):

      -    >>> users = api.GetFriends()
      -    >>> print [u.name for u in users]

      -  To post a twitter status message (after being authenticated):

      -    >>> status = api.PostUpdate('I love python-twitter!')
      -    >>> print status.text
      -    I love python-twitter!

      -  There are many other methods, including:

      -    >>> api.PostUpdates(status)
      -    >>> api.PostDirectMessage(user, text)
      -    >>> api.GetUser(user)
      -    >>> api.GetReplies()
      -    >>> api.GetUserTimeline(user)
      -    >>> api.GetStatus(id)
      -    >>> api.DestroyStatus(id)
      -    >>> api.GetFriends(user)
      -    >>> api.GetFollowers()
      -    >>> api.GetFeatured()
      -    >>> api.GetDirectMessages()
      -    >>> api.PostDirectMessage(user, text)
      -    >>> api.DestroyDirectMessage(id)
      -    >>> api.DestroyFriendship(user)
      -    >>> api.CreateFriendship(user)
      -    >>> api.GetUserByEmail(email)
      -    >>> api.VerifyCredentials()
       
       Methods defined here:
      -
      ClearCredentials(self)
      Clear the any credentials for this instance
      - -
      CreateFavorite(self, status)
      Favorites the status specified in the status parameter as the authenticating user.
      -Returns the favorite status when successful.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  The twitter.Status instance to mark as a favorite.
      -Returns:
      -  A twitter.Status instance representing the newly-marked favorite.
      - -
      CreateFriendship(self, user)
      Befriends the user specified in the user parameter as the authenticating user.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  The ID or screen name of the user to befriend.
      -Returns:
      -  A twitter.User instance representing the befriended user.
      - -
      CreateList(self, user, name, mode=None, description=None)
      Creates a new list with the given name

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user:
      -    Twitter name to create the list for
      -  name:
      -    New name for the list
      -  mode:
      -    'public' or 'private'.
      -    Defaults to 'public'. [Optional]
      -  description:
      -    Description of the list. [Optional]

      -Returns:
      -  A twitter.List instance representing the new list
      - -
      CreateSubscription(self, owner, list)
      Creates a subscription to a list by the authenticated user

      -The twitter.Api instance must be authenticated.

      -Args:
      -  owner:
      -    User name or id of the owner of the list being subscribed to.
      -  list:
      -    The slug or list id to subscribe the user to

      -Returns:
      -  A twitter.List instance representing the list subscribed to
      - -
      DestroyDirectMessage(self, id)
      Destroys the direct message specified in the required ID parameter.

      -The twitter.Api instance must be authenticated, and the
      -authenticating user must be the recipient of the specified direct
      -message.

      -Args:
      -  id: The id of the direct message to be destroyed

      -Returns:
      -  A twitter.DirectMessage instance representing the message destroyed
      - -
      DestroyFavorite(self, status)
      Un-favorites the status specified in the ID parameter as the authenticating user.
      -Returns the un-favorited status in the requested format when successful.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  The twitter.Status to unmark as a favorite.
      -Returns:
      -  A twitter.Status instance representing the newly-unmarked favorite.
      - -
      DestroyFriendship(self, user)
      Discontinues friendship with the user specified in the user parameter.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  The ID or screen name of the user  with whom to discontinue friendship.
      -Returns:
      -  A twitter.User instance representing the discontinued friend.
      - -
      DestroyList(self, user, id)
      Destroys the list from the given user

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user:
      -    The user to remove the list from.
      -  id:
      -    The slug or id of the list to remove.
      -Returns:
      -  A twitter.List instance representing the removed list.
      - -
      DestroyStatus(self, id)
      Destroys the status specified by the required ID parameter.

      -The twitter.Api instance must be authenticated and the
      -authenticating user must be the author of the specified status.

      -Args:
      -  id:
      -    The numerical ID of the status you're trying to destroy.

      -Returns:
      -  A twitter.Status instance representing the destroyed status message
      - -
      DestroySubscription(self, owner, list)
      Destroys the subscription to a list for the authenticated user

      -The twitter.Api instance must be authenticated.

      -Args:
      -  owner:
      -    The user id or screen name of the user that owns the
      -    list that is to be unsubscribed from
      -  list:
      -    The slug or list id of the list to unsubscribe from

      -Returns:
      -  A twitter.List instance representing the removed list.
      - -
      FilterPublicTimeline(self, term, since_id=None)
      Filter the public twitter timeline by a given search term on
      -the local machine.

      -Args:
      -  term:
      -    term to search by.
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]

      -Returns:
      -  A sequence of twitter.Status instances, one for each message
      -  containing the term
      - -
      GetDirectMessages(self, since=None, since_id=None, page=None)
      Returns a list of the direct messages sent to the authenticating user.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  since:
      -    Narrows the returned results to just those statuses created
      -    after the specified HTTP-formatted date. [Optional]
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]

      -Returns:
      -  A sequence of twitter.DirectMessage instances
      - -
      GetFavorites(self, user=None, page=None)
      Return a list of Status objects representing favorited tweets.
      -By default, returns the (up to) 20 most recent tweets for the
      -authenticated user.

      -Args:
      -  user:
      -    The twitter name or id of the user whose favorites you are fetching.
      -    If not specified, defaults to the authenticated user. [Optional]
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]
      - -
      GetFeatured(self)
      Fetch the sequence of twitter.User instances featured on twitter.com

      -The twitter.Api instance must be authenticated.

      -Returns:
      -  A sequence of twitter.User instances
      - -
      GetFollowerIDs(self, userid=None, cursor=-1)
      Fetch the sequence of twitter.User instances, one for each follower

      -The twitter.Api instance must be authenticated.

      -Returns:
      -  A sequence of twitter.User instances, one for each follower
      - -
      GetFollowers(self, page=None)
      Fetch the sequence of twitter.User instances, one for each follower

      -The twitter.Api instance must be authenticated.

      -Args:
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]

      -Returns:
      -  A sequence of twitter.User instances, one for each follower
      - -
      GetFriendIDs(self, user=None, cursor=-1)
      Returns a list of twitter user id's for every person
      -the specified user is following.

      -Args:
      -  user:
      -    The id or screen_name of the user to retrieve the id list for
      -    [Optional]

      -Returns:
      -  A list of integers, one for each user id.
      - -
      GetFriends(self, user=None, cursor=-1)
      Fetch the sequence of twitter.User instances, one for each friend.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user:
      -    The twitter name or id of the user whose friends you are fetching.
      -    If not specified, defaults to the authenticated user. [Optional]

      -Returns:
      -  A sequence of twitter.User instances, one for each friend
      - -
      GetLists(self, user, cursor=-1)
      Fetch the sequence of lists for a user.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user:
      -    The twitter name or id of the user whose friends you are fetching.
      -    If the passed in user is the same as the authenticated user
      -    then you will also receive private list data.
      -  cursor:
      -    "page" value that Twitter will use to start building the
      -    list sequence from.  -1 to start at the beginning.
      -    Twitter will return in the result the values for next_cursor
      -    and previous_cursor. [Optional]

      -Returns:
      -  A sequence of twitter.List instances, one for each list
      - -
      GetMentions(self, since_id=None, max_id=None, page=None)
      Returns the 20 most recent mentions (status containing @twitterID)
      -for the authenticating user.

      -Args:
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]
      -  max_id:
      -    Returns only statuses with an ID less than
      -    (that is, older than) the specified ID.  [Optional]
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]

      -Returns:
      -  A sequence of twitter.Status instances, one for each mention of the user.
      - -
      GetRateLimitStatus(self)
      Fetch the rate limit status for the currently authorized user.

      -Returns:
      -  A dictionary containing the time the limit will reset (reset_time),
      -  the number of remaining hits allowed before the reset (remaining_hits),
      -  the number of hits allowed in a 60-minute period (hourly_limit), and
      -  the time of the reset in seconds since The Epoch (reset_time_in_seconds).
      - -
      GetReplies(self, since=None, since_id=None, page=None)
      Get a sequence of status messages representing the 20 most
      -recent replies (status updates prefixed with @twitterID) to the
      -authenticating user.

      -Args:
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]
      -  since:

      -Returns:
      -  A sequence of twitter.Status instances, one for each reply to the user.
      - -
      GetRetweets(self, statusid)
      Returns up to 100 of the first retweets of the tweet identified
      -by statusid

      -Args:
      -  statusid:
      -    The ID of the tweet for which retweets should be searched for

      -Returns:
      -  A list of twitter.Status instances, which are retweets of statusid
      - -
      GetSearch(self, term, geocode=None, since_id=None, per_page=15, page=1, lang='en', show_user='true', query_users=False)
      Return twitter search results for a given term.

      -Args:
      -  term:
      -    term to search by.
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]
      -  geocode:
      -    geolocation information in the form (latitude, longitude, radius)
      -    [Optional]
      -  per_page:
      -    number of results to return.  Default is 15 [Optional]
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]
      -  lang:
      -    language for results.  Default is English [Optional]
      -  show_user:
      -    prefixes screen name in status
      -  query_users:
      -    If set to False, then all users only have screen_name and
      -    profile_image_url available.
      -    If set to True, all information of users are available,
      -    but it uses lots of request quota, one per status.

      -Returns:
      -  A sequence of twitter.Status instances, one for each message containing
      -  the term
      - -
      GetStatus(self, id)
      Returns a single status message.

      -The twitter.Api instance must be authenticated if the
      -status message is private.

      -Args:
      -  id:
      -    The numeric ID of the status you are trying to retrieve.

      -Returns:
      -  A twitter.Status instance representing that status message
      - -
      GetSubscriptions(self, user, cursor=-1)
      Fetch the sequence of Lists that the given user is subscribed to

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user:
      -    The twitter name or id of the user
      -  cursor:
      -    "page" value that Twitter will use to start building the
      -    list sequence from.  -1 to start at the beginning.
      -    Twitter will return in the result the values for next_cursor
      -    and previous_cursor. [Optional]

      -Returns:
      -  A sequence of twitter.List instances, one for each list
      - -
      GetTrendsCurrent(self, exclude=None)
      Get the current top trending topics

      -Args:
      -  exclude:
      -    Appends the exclude parameter as a request parameter.
      -    Currently only exclude=hashtags is supported. [Optional]

      -Returns:
      -  A list with 10 entries. Each entry contains the twitter.
      - -
      GetTrendsDaily(self, exclude=None, startdate=None)
      Get the current top trending topics for each hour in a given day

      -Args:
      -  startdate:
      -    The start date for the report.
      -    Should be in the format YYYY-MM-DD. [Optional]
      -  exclude:
      -    Appends the exclude parameter as a request parameter.
      -    Currently only exclude=hashtags is supported. [Optional]

      -Returns:
      -  A list with 24 entries. Each entry contains the twitter.
      -  Trend elements that were trending at the corresponding hour of the day.
      - -
      GetTrendsWeekly(self, exclude=None, startdate=None)
      Get the top 30 trending topics for each day in a given week.

      -Args:
      -  startdate:
      -    The start date for the report.
      -    Should be in the format YYYY-MM-DD. [Optional]
      -  exclude:
      -    Appends the exclude parameter as a request parameter.
      -    Currently only exclude=hashtags is supported. [Optional]
      -Returns:
      -  A list with each entry contains the twitter.
      -  Trend elements of trending topics for the corrsponding day of the week
      - -
      GetUser(self, user)
      Returns a single user.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user: The twitter name or id of the user to retrieve.

      -Returns:
      -  A twitter.User instance representing that user
      - -
      GetUserByEmail(self, email)
      Returns a single user by email address.

      -Args:
      -  email:
      -    The email of the user to retrieve.

      -Returns:
      -  A twitter.User instance representing that user
      - -
      GetUserRetweets(self, count=None, since_id=None, max_id=None, include_entities=False)
      Fetch the sequence of retweets made by a single user.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  count:
      -    The number of status messages to retrieve. [Optional]
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]
      -  max_id:
      -    Returns results with an ID less than (that is, older than) or
      -    equal to the specified ID. [Optional]
      -  include_entities:
      -    If True, each tweet will include a node called "entities,".
      -    This node offers a variety of metadata about the tweet in a
      -    discreet structure, including: user_mentions, urls, and
      -    hashtags. [Optional]

      -Returns:
      -  A sequence of twitter.Status instances, one for each message up to count
      - -
      GetUserTimeline(self, id=None, user_id=None, screen_name=None, since_id=None, max_id=None, count=None, page=None, include_rts=None, include_entities=None)
      Fetch the sequence of public Status messages for a single user.

      -The twitter.Api instance must be authenticated if the user is private.

      -Args:
      -  id:
      -    Specifies the ID or screen name of the user for whom to return
      -    the user_timeline. [Optional]
      -  user_id:
      -    Specfies the ID of the user for whom to return the
      -    user_timeline. Helpful for disambiguating when a valid user ID
      -    is also a valid screen name. [Optional]
      -  screen_name:
      -    Specfies the screen name of the user for whom to return the
      -    user_timeline. Helpful for disambiguating when a valid screen
      -    name is also a user ID. [Optional]
      -  since_id:
      -    Returns results with an ID greater than (that is, more recent
      -    than) the specified ID. There are limits to the number of
      -    Tweets which can be accessed through the API. If the limit of
      -    Tweets has occured since the since_id, the since_id will be
      -    forced to the oldest ID available. [Optional]
      -  max_id:
      -    Returns only statuses with an ID less than (that is, older
      -    than) or equal to the specified ID. [Optional]
      -  count:
      -    Specifies the number of statuses to retrieve. May not be
      -    greater than 200.  [Optional]
      -  page:
      -    Specifies the page of results to retrieve.
      -    Note: there are pagination limits. [Optional]
      -  include_rts:
      -    If True, the timeline will contain native retweets (if they
      -    exist) in addition to the standard stream of tweets. [Optional]
      -  include_entities:
      -    If True, each tweet will include a node called "entities,".
      -    This node offers a variety of metadata about the tweet in a
      -    discreet structure, including: user_mentions, urls, and
      -    hashtags. [Optional]

      -Returns:
      -  A sequence of Status instances, one for each message up to count
      - -
      MaximumHitFrequency(self)
      Determines the minimum number of seconds that a program must wait
      -before hitting the server again without exceeding the rate_limit
      -imposed for the currently authenticated user.

      -Returns:
      -  The minimum second interval that a program must use so as to not
      -  exceed the rate_limit imposed for the user.
      - -
      PostDirectMessage(self, user, text)
      Post a twitter direct message from the authenticated user

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user: The ID or screen name of the recipient user.
      -  text: The message text to be posted.  Must be less than 140 characters.

      -Returns:
      -  A twitter.DirectMessage instance representing the message posted
      - -
      PostUpdate(self, status, in_reply_to_status_id=None)
      Post a twitter status message from the authenticated user.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  status:
      -    The message text to be posted.
      -    Must be less than or equal to 140 characters.
      -  in_reply_to_status_id:
      -    The ID of an existing status that the status to be posted is
      -    in reply to.  This implicitly sets the in_reply_to_user_id
      -    attribute of the resulting status to the user ID of the
      -    message being replied to.  Invalid/missing status IDs will be
      -    ignored. [Optional]
      -Returns:
      -  A twitter.Status instance representing the message posted.
      - -
      PostUpdates(self, status, continuation=None, **kwargs)
      Post one or more twitter status messages from the authenticated user.

      -Unlike api.PostUpdate, this method will post multiple status updates
      -if the message is longer than 140 characters.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  status:
      -    The message text to be posted.
      -    May be longer than 140 characters.
      -  continuation:
      -    The character string, if any, to be appended to all but the
      -    last message.  Note that Twitter strips trailing '...' strings
      -    from messages.  Consider using the unicode \u2026 character
      -    (horizontal ellipsis) instead. [Defaults to None]
      -  **kwargs:
      -    See api.PostUpdate for a list of accepted parameters.

      -Returns:
      -  A of list twitter.Status instance representing the messages posted.
      - -
      SetCache(self, cache)
      Override the default cache.  Set to None to prevent caching.

      -Args:
      -  cache:
      -    An instance that supports the same API as the twitter._FileCache
      - -
      SetCacheTimeout(self, cache_timeout)
      Override the default cache timeout.

      -Args:
      -  cache_timeout:
      -    Time, in seconds, that responses should be reused.
      - -
      SetCredentials(self, consumer_key, consumer_secret, access_token_key=None, access_token_secret=None)
      Set the consumer_key and consumer_secret for this instance

      -Args:
      -  consumer_key:
      -    The consumer_key of the twitter account.
      -  consumer_secret:
      -    The consumer_secret for the twitter account.
      -  access_token_key:
      -    The oAuth access token key value you retrieved
      -    from running get_access_token.py.
      -  access_token_secret:
      -    The oAuth access token's secret, also retrieved
      -    from the get_access_token.py run.
      - -
      SetSource(self, source)
      Suggest the "from source" value to be displayed on the Twitter web site.

      -The value of the 'source' parameter must be first recognized by
      -the Twitter server.  New source values are authorized on a case by
      -case basis by the Twitter development team.

      -Args:
      -  source:
      -    The source name as a string.  Will be sent to the server as
      -    the 'source' parameter.
      - -
      SetUrllib(self, urllib)
      Override the default urllib implementation.

      -Args:
      -  urllib:
      -    An instance that supports the same API as the urllib2 module
      - -
      SetUserAgent(self, user_agent)
      Override the default user agent

      -Args:
      -  user_agent:
      -    A string that should be send to the server as the User-agent
      - -
      SetXTwitterHeaders(self, client, url, version)
      Set the X-Twitter HTTP headers that will be sent to the server.

      -Args:
      -  client:
      -     The client name as a string.  Will be sent to the server as
      -     the 'X-Twitter-Client' header.
      -  url:
      -     The URL of the meta.xml as a string.  Will be sent to the server
      -     as the 'X-Twitter-Client-URL' header.
      -  version:
      -     The client version as a string.  Will be sent to the server
      -     as the 'X-Twitter-Client-Version' header.
      - -
      UsersLookup(self, user_id=None, screen_name=None, users=None)
      Fetch extended information for the specified users.

      -Users may be specified either as lists of either user_ids,
      -screen_names, or twitter.User objects. The list of users that
      -are queried is the union of all specified parameters.

      -The twitter.Api instance must be authenticated.

      -Args:
      -  user_id:
      -    A list of user_ids to retrieve extended information.
      -    [Optional]
      -  screen_name:
      -    A list of screen_names to retrieve extended information.
      -    [Optional]
      -  users:
      -    A list of twitter.User objects to retrieve extended information.
      -    [Optional]

      -Returns:
      -  A list of twitter.User objects for the requested users
      - -
      VerifyCredentials(self)
      Returns a twitter.User instance if the authenticating user is valid.

      -Returns:
      -  A twitter.User instance representing that user if the
      -  credentials are valid, None otherwise.
      - -
      __init__(self, consumer_key=None, consumer_secret=None, access_token_key=None, access_token_secret=None, input_encoding=None, request_headers=None, cache=<object object at 0x1001da0a0>, shortner=None, base_url=None, use_gzip_compression=False, debugHTTP=False)
      Instantiate a new twitter.Api object.

      -Args:
      -  consumer_key:
      -    Your Twitter user's consumer_key.
      -  consumer_secret:
      -    Your Twitter user's consumer_secret.
      -  access_token_key:
      -    The oAuth access token key value you retrieved
      -    from running get_access_token.py.
      -  access_token_secret:
      -    The oAuth access token's secret, also retrieved
      -    from the get_access_token.py run.
      -  input_encoding:
      -    The encoding used to encode input strings. [Optional]
      -  request_header:
      -    A dictionary of additional HTTP request headers. [Optional]
      -  cache:
      -    The cache instance to use. Defaults to DEFAULT_CACHE.
      -    Use None to disable caching. [Optional]
      -  shortner:
      -    The shortner instance to use.  Defaults to None.
      -    See shorten_url.py for an example shortner. [Optional]
      -  base_url:
      -    The base URL to use to contact the Twitter API.
      -    Defaults to https://twitter.com. [Optional]
      -  use_gzip_compression:
      -    Set to True to tell enable gzip compression for any call
      -    made to Twitter.  Defaults to False. [Optional]
      -  debugHTTP:
      -    Set to True to enable debug output from urllib2 when performing
      -    any HTTP requests.  Defaults to False. [Optional]
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -
      -Data and other attributes defined here:
      -
      DEFAULT_CACHE_TIMEOUT = 60
      - -

      - - - - - - - -
       
      -class DirectMessage(__builtin__.object)
         A class representing the DirectMessage structure used by the twitter API.

      -The DirectMessage structure exposes the following properties:

      -  direct_message.id
      -  direct_message.created_at
      -  direct_message.created_at_in_seconds # read only
      -  direct_message.sender_id
      -  direct_message.sender_screen_name
      -  direct_message.recipient_id
      -  direct_message.recipient_screen_name
      -  direct_message.text
       
       Methods defined here:
      -
      AsDict(self)
      A dict representation of this twitter.DirectMessage instance.

      -The return value uses the same key names as the JSON representation.

      -Return:
      -  A dict representing this twitter.DirectMessage instance
      - -
      AsJsonString(self)
      A JSON string representation of this twitter.DirectMessage instance.

      -Returns:
      -  A JSON string representation of this twitter.DirectMessage instance
      - -
      GetCreatedAt(self)
      Get the time this direct message was posted.

      -Returns:
      -  The time this direct message was posted
      - -
      GetCreatedAtInSeconds(self)
      Get the time this direct message was posted, in seconds since the epoch.

      -Returns:
      -  The time this direct message was posted, in seconds since the epoch.
      - -
      GetId(self)
      Get the unique id of this direct message.

      -Returns:
      -  The unique id of this direct message
      - -
      GetRecipientId(self)
      Get the unique recipient id of this direct message.

      -Returns:
      -  The unique recipient id of this direct message
      - -
      GetRecipientScreenName(self)
      Get the unique recipient screen name of this direct message.

      -Returns:
      -  The unique recipient screen name of this direct message
      - -
      GetSenderId(self)
      Get the unique sender id of this direct message.

      -Returns:
      -  The unique sender id of this direct message
      - -
      GetSenderScreenName(self)
      Get the unique sender screen name of this direct message.

      -Returns:
      -  The unique sender screen name of this direct message
      - -
      GetText(self)
      Get the text of this direct message.

      -Returns:
      -  The text of this direct message.
      - -
      SetCreatedAt(self, created_at)
      Set the time this direct message was posted.

      -Args:
      -  created_at:
      -    The time this direct message was created
      - -
      SetId(self, id)
      Set the unique id of this direct message.

      -Args:
      -  id:
      -    The unique id of this direct message
      - -
      SetRecipientId(self, recipient_id)
      Set the unique recipient id of this direct message.

      -Args:
      -  recipient_id:
      -    The unique recipient id of this direct message
      - -
      SetRecipientScreenName(self, recipient_screen_name)
      Set the unique recipient screen name of this direct message.

      -Args:
      -  recipient_screen_name:
      -    The unique recipient screen name of this direct message
      - -
      SetSenderId(self, sender_id)
      Set the unique sender id of this direct message.

      -Args:
      -  sender_id:
      -    The unique sender id of this direct message
      - -
      SetSenderScreenName(self, sender_screen_name)
      Set the unique sender screen name of this direct message.

      -Args:
      -  sender_screen_name:
      -    The unique sender screen name of this direct message
      - -
      SetText(self, text)
      Set the text of this direct message.

      -Args:
      -  text:
      -    The text of this direct message
      - -
      __eq__(self, other)
      - -
      __init__(self, id=None, created_at=None, sender_id=None, sender_screen_name=None, recipient_id=None, recipient_screen_name=None, text=None)
      An object to hold a Twitter direct message.

      -This class is normally instantiated by the twitter.Api class and
      -returned in a sequence.

      -Note: Dates are posted in the form "Sat Jan 27 04:17:38 +0000 2007"

      -Args:
      -  id:
      -    The unique id of this direct message. [Optional]
      -  created_at:
      -    The time this direct message was posted. [Optional]
      -  sender_id:
      -    The id of the twitter user that sent this message. [Optional]
      -  sender_screen_name:
      -    The name of the twitter user that sent this message. [Optional]
      -  recipient_id:
      -    The id of the twitter that received this message. [Optional]
      -  recipient_screen_name:
      -    The name of the twitter that received this message. [Optional]
      -  text:
      -    The text of this direct message. [Optional]
      - -
      __ne__(self, other)
      - -
      __str__(self)
      A string representation of this twitter.DirectMessage instance.

      -The return value is the same as the JSON string representation.

      -Returns:
      -  A string representation of this twitter.DirectMessage instance.
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data)
      Create a new instance based on a JSON dict.

      -Args:
      -  data:
      -    A JSON dict, as converted from the JSON in the twitter API

      -Returns:
      -  A twitter.DirectMessage instance
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -
      created_at
      -
      The time this direct message was posted.
      -
      -
      created_at_in_seconds
      -
      The time this direct message was posted, in seconds since the epoch
      -
      -
      id
      -
      The unique id of this direct message.
      -
      -
      recipient_id
      -
      The unique recipient id of this direct message.
      -
      -
      recipient_screen_name
      -
      The unique recipient screen name of this direct message.
      -
      -
      sender_id
      -
      The unique sender id of this direct message.
      -
      -
      sender_screen_name
      -
      The unique sender screen name of this direct message.
      -
      -
      text
      -
      The text of this direct message
      -
      -

      - - - - - - - -
       
      -class Hashtag(__builtin__.object)
         A class represeinting a twitter hashtag
       
       Methods defined here:
      -
      __init__(self, text=None)
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data)
      Create a new instance based on a JSON dict.

      -Args:
      -  data:
      -    A JSON dict, as converted from the JSON in the twitter API

      -Returns:
      -  A twitter.Hashtag instance
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -

      - - - - - - - -
       
      -class List(__builtin__.object)
         A class representing the List structure used by the twitter API.

      -The List structure exposes the following properties:

      -  list.id
      -  list.name
      -  list.slug
      -  list.description
      -  list.full_name
      -  list.mode
      -  list.uri
      -  list.member_count
      -  list.subscriber_count
      -  list.following
       
       Methods defined here:
      -
      AsDict(self)
      A dict representation of this twitter.List instance.

      -The return value uses the same key names as the JSON representation.

      -Return:
      -  A dict representing this twitter.List instance
      - -
      AsJsonString(self)
      A JSON string representation of this twitter.List instance.

      -Returns:
      -  A JSON string representation of this twitter.List instance
      - -
      GetDescription(self)
      Get the description of this list.

      -Returns:
      -  The description of this list
      - -
      GetFollowing(self)
      Get the following status of this list.

      -Returns:
      -  The following status of this list
      - -
      GetFull_name(self)
      Get the full_name of this list.

      -Returns:
      -  The full_name of this list
      - -
      GetId(self)
      Get the unique id of this list.

      -Returns:
      -  The unique id of this list
      - -
      GetMember_count(self)
      Get the member_count of this list.

      -Returns:
      -  The member_count of this list
      - -
      GetMode(self)
      Get the mode of this list.

      -Returns:
      -  The mode of this list
      - -
      GetName(self)
      Get the real name of this list.

      -Returns:
      -  The real name of this list
      - -
      GetSlug(self)
      Get the slug of this list.

      -Returns:
      -  The slug of this list
      - -
      GetSubscriber_count(self)
      Get the subscriber_count of this list.

      -Returns:
      -  The subscriber_count of this list
      - -
      GetUri(self)
      Get the uri of this list.

      -Returns:
      -  The uri of this list
      - -
      GetUser(self)
      Get the user of this list.

      -Returns:
      -  The owner of this list
      - -
      SetDescription(self, description)
      Set the description of this list.

      -Args:
      -  description:
      -    The description of this list.
      - -
      SetFollowing(self, following)
      Set the following status of this list.

      -Args:
      -  following:
      -    The following of this list.
      - -
      SetFull_name(self, full_name)
      Set the full_name of this list.

      -Args:
      -  full_name:
      -    The full_name of this list.
      - -
      SetId(self, id)
      Set the unique id of this list.

      -Args:
      -  id:
      -    The unique id of this list.
      - -
      SetMember_count(self, member_count)
      Set the member_count of this list.

      -Args:
      -  member_count:
      -    The member_count of this list.
      - -
      SetMode(self, mode)
      Set the mode of this list.

      -Args:
      -  mode:
      -    The mode of this list.
      - -
      SetName(self, name)
      Set the real name of this list.

      -Args:
      -  name:
      -    The real name of this list
      - -
      SetSlug(self, slug)
      Set the slug of this list.

      -Args:
      -  slug:
      -    The slug of this list.
      - -
      SetSubscriber_count(self, subscriber_count)
      Set the subscriber_count of this list.

      -Args:
      -  subscriber_count:
      -    The subscriber_count of this list.
      - -
      SetUri(self, uri)
      Set the uri of this list.

      -Args:
      -  uri:
      -    The uri of this list.
      - -
      SetUser(self, user)
      Set the user of this list.

      -Args:
      -  user:
      -    The owner of this list.
      - -
      __eq__(self, other)
      - -
      __init__(self, id=None, name=None, slug=None, description=None, full_name=None, mode=None, uri=None, member_count=None, subscriber_count=None, following=None, user=None)
      - -
      __ne__(self, other)
      - -
      __str__(self)
      A string representation of this twitter.List instance.

      -The return value is the same as the JSON string representation.

      -Returns:
      -  A string representation of this twitter.List instance.
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data)
      Create a new instance based on a JSON dict.

      -Args:
      -  data:
      -    A JSON dict, as converted from the JSON in the twitter API

      -Returns:
      -  A twitter.List instance
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -
      description
      -
      The description of this list.
      -
      -
      following
      -
      The following status of this list.
      -
      -
      full_name
      -
      The full_name of this list.
      -
      -
      id
      -
      The unique id of this list.
      -
      -
      member_count
      -
      The member_count of this list.
      -
      -
      mode
      -
      The mode of this list.
      -
      -
      name
      -
      The real name of this list.
      -
      -
      slug
      -
      The slug of this list.
      -
      -
      subscriber_count
      -
      The subscriber_count of this list.
      -
      -
      uri
      -
      The uri of this list.
      -
      -
      user
      -
      The owner of this list.
      -
      -

      - - - - - - - -
       
      -class Status(__builtin__.object)
         A class representing the Status structure used by the twitter API.

      -The Status structure exposes the following properties:

      -  status.created_at
      -  status.created_at_in_seconds # read only
      -  status.favorited
      -  status.in_reply_to_screen_name
      -  status.in_reply_to_user_id
      -  status.in_reply_to_status_id
      -  status.truncated
      -  status.source
      -  status.id
      -  status.text
      -  status.location
      -  status.relative_created_at # read only
      -  status.user
      -  status.urls
      -  status.user_mentions
      -  status.hashtags
       
       Methods defined here:
      -
      AsDict(self)
      A dict representation of this twitter.Status instance.

      -The return value uses the same key names as the JSON representation.

      -Return:
      -  A dict representing this twitter.Status instance
      - -
      AsJsonString(self)
      A JSON string representation of this twitter.Status instance.

      -Returns:
      -  A JSON string representation of this twitter.Status instance
      - -
      GetCreatedAt(self)
      Get the time this status message was posted.

      -Returns:
      -  The time this status message was posted
      - -
      GetCreatedAtInSeconds(self)
      Get the time this status message was posted, in seconds since the epoch.

      -Returns:
      -  The time this status message was posted, in seconds since the epoch.
      - -
      GetFavorited(self)
      Get the favorited setting of this status message.

      -Returns:
      -  True if this status message is favorited; False otherwise
      - -
      GetId(self)
      Get the unique id of this status message.

      -Returns:
      -  The unique id of this status message
      - -
      GetInReplyToScreenName(self)
      - -
      GetInReplyToStatusId(self)
      - -
      GetInReplyToUserId(self)
      - -
      GetLocation(self)
      Get the geolocation associated with this status message

      -Returns:
      -  The geolocation string of this status message.
      - -
      GetNow(self)
      Get the wallclock time for this status message.

      -Used to calculate relative_created_at.  Defaults to the time
      -the object was instantiated.

      -Returns:
      -  Whatever the status instance believes the current time to be,
      -  in seconds since the epoch.
      - -
      GetRelativeCreatedAt(self)
      Get a human redable string representing the posting time

      -Returns:
      -  A human readable string representing the posting time
      - -
      GetSource(self)
      - -
      GetText(self)
      Get the text of this status message.

      -Returns:
      -  The text of this status message.
      - -
      GetTruncated(self)
      - -
      GetUser(self)
      Get a twitter.User reprenting the entity posting this status message.

      -Returns:
      -  A twitter.User reprenting the entity posting this status message
      - -
      SetCreatedAt(self, created_at)
      Set the time this status message was posted.

      -Args:
      -  created_at:
      -    The time this status message was created
      - -
      SetFavorited(self, favorited)
      Set the favorited state of this status message.

      -Args:
      -  favorited:
      -    boolean True/False favorited state of this status message
      - -
      SetId(self, id)
      Set the unique id of this status message.

      -Args:
      -  id:
      -    The unique id of this status message
      - -
      SetInReplyToScreenName(self, in_reply_to_screen_name)
      - -
      SetInReplyToStatusId(self, in_reply_to_status_id)
      - -
      SetInReplyToUserId(self, in_reply_to_user_id)
      - -
      SetLocation(self, location)
      Set the geolocation associated with this status message

      -Args:
      -  location:
      -    The geolocation string of this status message
      - -
      SetNow(self, now)
      Set the wallclock time for this status message.

      -Used to calculate relative_created_at.  Defaults to the time
      -the object was instantiated.

      -Args:
      -  now:
      -    The wallclock time for this instance.
      - -
      SetSource(self, source)
      - -
      SetText(self, text)
      Set the text of this status message.

      -Args:
      -  text:
      -    The text of this status message
      - -
      SetTruncated(self, truncated)
      - -
      SetUser(self, user)
      Set a twitter.User reprenting the entity posting this status message.

      -Args:
      -  user:
      -    A twitter.User reprenting the entity posting this status message
      - -
      __eq__(self, other)
      - -
      __init__(self, created_at=None, favorited=None, id=None, text=None, location=None, user=None, in_reply_to_screen_name=None, in_reply_to_user_id=None, in_reply_to_status_id=None, truncated=None, source=None, now=None, urls=None, user_mentions=None, hashtags=None)
      An object to hold a Twitter status message.

      -This class is normally instantiated by the twitter.Api class and
      -returned in a sequence.

      -Note: Dates are posted in the form "Sat Jan 27 04:17:38 +0000 2007"

      -Args:
      -  created_at:
      -    The time this status message was posted. [Optiona]
      -  favorited:
      -    Whether this is a favorite of the authenticated user. [Optiona]
      -  id:
      -    The unique id of this status message. [Optiona]
      -  text:
      -    The text of this status message. [Optiona]
      -  location:
      -    the geolocation string associated with this message. [Optiona]
      -  relative_created_at:
      -    A human readable string representing the posting time. [Optiona]
      -  user:
      -    A twitter.User instance representing the person posting the
      -    message. [Optiona]
      -  now:
      -    The current time, if the client choses to set it.
      -    Defaults to the wall clock time. [Optiona]
      - -
      __ne__(self, other)
      - -
      __str__(self)
      A string representation of this twitter.Status instance.

      -The return value is the same as the JSON string representation.

      -Returns:
      -  A string representation of this twitter.Status instance.
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data)
      Create a new instance based on a JSON dict.

      -Args:
      -  data: A JSON dict, as converted from the JSON in the twitter API
      -Returns:
      -  A twitter.Status instance
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -
      created_at
      -
      The time this status message was posted.
      -
      -
      created_at_in_seconds
      -
      The time this status message was posted, in seconds since the epoch
      -
      -
      favorited
      -
      The favorited state of this status message.
      -
      -
      id
      -
      The unique id of this status message.
      -
      -
      in_reply_to_screen_name
      -
      -
      -
      in_reply_to_status_id
      -
      -
      -
      in_reply_to_user_id
      -
      -
      -
      location
      -
      The geolocation string of this status message
      -
      -
      now
      -
      The wallclock time for this status instance.
      -
      -
      relative_created_at
      -
      Get a human readable string representing the posting time
      -
      -
      source
      -
      -
      -
      text
      -
      The text of this status message
      -
      -
      truncated
      -
      -
      -
      user
      -
      A twitter.User reprenting the entity posting this status message
      -
      -

      - - - - - - - -
       
      -class Trend(__builtin__.object)
         A class representing a trending topic
       
       Methods defined here:
      -
      __init__(self, name=None, query=None, timestamp=None)
      - -
      __str__(self)
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data, timestamp=None)
      Create a new instance based on a JSON dict

      -Args:
      -  data:
      -    A JSON dict
      -  timestamp:
      -    Gets set as the timestamp property of the new object

      -Returns:
      -  A twitter.Trend object
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -

      - - - - - - - -
       
      -class TwitterError(exceptions.Exception)
         Base class for Twitter errors
       
       
      Method resolution order:
      -
      TwitterError
      -
      exceptions.Exception
      -
      exceptions.BaseException
      -
      __builtin__.object
      -
      -
      -Data descriptors defined here:
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -
      message
      -
      Returns the first argument used to construct this error.
      -
      -
      -Methods inherited from exceptions.Exception:
      -
      __init__(...)
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature
      - -
      -Data and other attributes inherited from exceptions.Exception:
      -
      __new__ = <built-in method __new__ of type object at 0x100119f80>
      T.__new__(S, ...) -> a new object with type S, a subtype of T
      - -
      -Methods inherited from exceptions.BaseException:
      -
      __delattr__(...)
      x.__delattr__('name') <==> del x.name
      - -
      __getattribute__(...)
      x.__getattribute__('name') <==> x.name
      - -
      __getitem__(...)
      x.__getitem__(y) <==> x[y]
      - -
      __getslice__(...)
      x.__getslice__(i, j) <==> x[i:j]

      -Use of negative indices is not supported.
      - -
      __reduce__(...)
      - -
      __repr__(...)
      x.__repr__() <==> repr(x)
      - -
      __setattr__(...)
      x.__setattr__('name', value) <==> x.name = value
      - -
      __setstate__(...)
      - -
      __str__(...)
      x.__str__() <==> str(x)
      - -
      __unicode__(...)
      - -
      -Data descriptors inherited from exceptions.BaseException:
      -
      __dict__
      -
      -
      args
      -
      -

      - - - - - - - -
       
      -class Url(__builtin__.object)
         A class representing an URL contained in a tweet
       
       Methods defined here:
      -
      __init__(self, url=None, expanded_url=None)
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data)
      Create a new instance based on a JSON dict.

      -Args:
      -  data:
      -    A JSON dict, as converted from the JSON in the twitter API

      -Returns:
      -  A twitter.Url instance
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -

      +

       
      + Modules
              + + + + + + + +
      StringIO
      + base64
      + calendar
      + datetime
      + gzip
      +
      httplib
      + oauth2
      + os
      + rfc822
      + json
      +
      sys
      + tempfile
      + textwrap
      + time
      + urllib
      +
      urllib2
      + urlparse
      +
      +
      +

      - - - - - - -
       
      -class User(__builtin__.object)
         A class representing the User structure used by the twitter API.

      -The User structure exposes the following properties:

      -  user.id
      -  user.name
      -  user.screen_name
      -  user.location
      -  user.description
      -  user.profile_image_url
      -  user.profile_background_tile
      -  user.profile_background_image_url
      -  user.profile_sidebar_fill_color
      -  user.profile_background_color
      -  user.profile_link_color
      -  user.profile_text_color
      -  user.protected
      -  user.utc_offset
      -  user.time_zone
      -  user.url
      -  user.status
      -  user.statuses_count
      -  user.followers_count
      -  user.friends_count
      -  user.favourites_count
       
       Methods defined here:
      -
      AsDict(self)
      A dict representation of this twitter.User instance.

      -The return value uses the same key names as the JSON representation.

      -Return:
      -  A dict representing this twitter.User instance
      - -
      AsJsonString(self)
      A JSON string representation of this twitter.User instance.

      -Returns:
      -  A JSON string representation of this twitter.User instance
      - -
      GetDescription(self)
      Get the short text description of this user.

      -Returns:
      -  The short text description of this user
      - -
      GetFavouritesCount(self)
      Get the number of favourites for this user.

      -Returns:
      -  The number of favourites for this user.
      - -
      GetFollowersCount(self)
      Get the follower count for this user.

      -Returns:
      -  The number of users following this user.
      - -
      GetFriendsCount(self)
      Get the friend count for this user.

      -Returns:
      -  The number of users this user has befriended.
      - -
      GetId(self)
      Get the unique id of this user.

      -Returns:
      -  The unique id of this user
      - -
      GetLocation(self)
      Get the geographic location of this user.

      -Returns:
      -  The geographic location of this user
      - -
      GetName(self)
      Get the real name of this user.

      -Returns:
      -  The real name of this user
      - -
      GetProfileBackgroundColor(self)
      - -
      GetProfileBackgroundImageUrl(self)
      - -
      GetProfileBackgroundTile(self)
      Boolean for whether to tile the profile background image.

      -Returns:
      -  True if the background is to be tiled, False if not, None if unset.
      - -
      GetProfileImageUrl(self)
      Get the url of the thumbnail of this user.

      -Returns:
      -  The url of the thumbnail of this user
      - -
      GetProfileLinkColor(self)
      - -
      GetProfileSidebarFillColor(self)
      - -
      GetProfileTextColor(self)
      - -
      GetProtected(self)
      - -
      GetScreenName(self)
      Get the short twitter name of this user.

      -Returns:
      -  The short twitter name of this user
      - -
      GetStatus(self)
      Get the latest twitter.Status of this user.

      -Returns:
      -  The latest twitter.Status of this user
      - -
      GetStatusesCount(self)
      Get the number of status updates for this user.

      -Returns:
      -  The number of status updates for this user.
      - -
      GetTimeZone(self)
      Returns the current time zone string for the user.

      -Returns:
      -  The descriptive time zone string for the user.
      - -
      GetUrl(self)
      Get the homepage url of this user.

      -Returns:
      -  The homepage url of this user
      - -
      GetUtcOffset(self)
      - -
      SetDescription(self, description)
      Set the short text description of this user.

      -Args:
      -  description: The short text description of this user
      - -
      SetFavouritesCount(self, count)
      Set the favourite count for this user.

      -Args:
      -  count:
      -    The number of favourites for this user.
      - -
      SetFollowersCount(self, count)
      Set the follower count for this user.

      -Args:
      -  count:
      -    The number of users following this user.
      - -
      SetFriendsCount(self, count)
      Set the friend count for this user.

      -Args:
      -  count:
      -    The number of users this user has befriended.
      - -
      SetId(self, id)
      Set the unique id of this user.

      -Args:
      -  id: The unique id of this user.
      - -
      SetLocation(self, location)
      Set the geographic location of this user.

      -Args:
      -  location: The geographic location of this user
      - -
      SetName(self, name)
      Set the real name of this user.

      -Args:
      -  name: The real name of this user
      - -
      SetProfileBackgroundColor(self, profile_background_color)
      - -
      SetProfileBackgroundImageUrl(self, profile_background_image_url)
      - -
      SetProfileBackgroundTile(self, profile_background_tile)
      Set the boolean flag for whether to tile the profile background image.

      -Args:
      -  profile_background_tile: Boolean flag for whether to tile or not.
      - -
      SetProfileImageUrl(self, profile_image_url)
      Set the url of the thumbnail of this user.

      -Args:
      -  profile_image_url: The url of the thumbnail of this user
      - -
      SetProfileLinkColor(self, profile_link_color)
      - -
      SetProfileSidebarFillColor(self, profile_sidebar_fill_color)
      - -
      SetProfileTextColor(self, profile_text_color)
      - -
      SetProtected(self, protected)
      - -
      SetScreenName(self, screen_name)
      Set the short twitter name of this user.

      -Args:
      -  screen_name: the short twitter name of this user
      - -
      SetStatus(self, status)
      Set the latest twitter.Status of this user.

      -Args:
      -  status:
      -    The latest twitter.Status of this user
      - -
      SetStatusesCount(self, count)
      Set the status update count for this user.

      -Args:
      -  count:
      -    The number of updates for this user.
      - -
      SetTimeZone(self, time_zone)
      Sets the user's time zone string.

      -Args:
      -  time_zone:
      -    The descriptive time zone to assign for the user.
      - -
      SetUrl(self, url)
      Set the homepage url of this user.

      -Args:
      -  url: The homepage url of this user
      - -
      SetUtcOffset(self, utc_offset)
      - -
      __eq__(self, other)
      - -
      __init__(self, id=None, name=None, screen_name=None, location=None, description=None, profile_image_url=None, profile_background_tile=None, profile_background_image_url=None, profile_sidebar_fill_color=None, profile_background_color=None, profile_link_color=None, profile_text_color=None, protected=None, utc_offset=None, time_zone=None, followers_count=None, friends_count=None, statuses_count=None, favourites_count=None, url=None, status=None)
      - -
      __ne__(self, other)
      - -
      __str__(self)
      A string representation of this twitter.User instance.

      -The return value is the same as the JSON string representation.

      -Returns:
      -  A string representation of this twitter.User instance.
      - -
      -Static methods defined here:
      -
      NewFromJsonDict(data)
      Create a new instance based on a JSON dict.

      -Args:
      -  data:
      -    A JSON dict, as converted from the JSON in the twitter API

      -Returns:
      -  A twitter.User instance
      - -
      -Data descriptors defined here:
      -
      __dict__
      -
      dictionary for instance variables (if defined)
      -
      -
      __weakref__
      -
      list of weak references to the object (if defined)
      -
      -
      description
      -
      The short text description of this user.
      -
      -
      favourites_count
      -
      The number of favourites for this user.
      -
      -
      followers_count
      -
      The number of users following this user.
      -
      -
      friends_count
      -
      The number of friends for this user.
      -
      -
      id
      -
      The unique id of this user.
      -
      -
      location
      -
      The geographic location of this user.
      -
      -
      name
      -
      The real name of this user.
      -
      -
      profile_background_color
      -
      -
      profile_background_image_url
      -
      The url of the profile background of this user.
      -
      -
      profile_background_tile
      -
      Boolean for whether to tile the background image.
      -
      -
      profile_image_url
      -
      The url of the thumbnail of this user.
      -
      -
      profile_link_color
      -
      -
      profile_sidebar_fill_color
      -
      -
      profile_text_color
      -
      -
      protected
      -
      -
      screen_name
      -
      The short twitter name of this user.
      -
      -
      status
      -
      The latest twitter.Status of this user.
      -
      -
      statuses_count
      -
      The number of updates for this user.
      -
      -
      time_zone
      -
      Returns the current time zone string for the user.

      -Returns:
      -  The descriptive time zone string for the user.
      -
      -
      url
      -
      The homepage url of this user.
      -
      -
      utc_offset
      -
      -

      + +  
      + Classes + + + +        +   + +

      +
      __builtin__.object +
      +
      +
      +
      Api +
      +
      DirectMessage +
      +
      Hashtag +
      +
      List +
      +
      Status +
      +
      Trend +
      +
      Url +
      +
      User +
      +
      +
      +
      exceptions.Exception(exceptions.BaseException) +
      +
      +
      +
      TwitterError +
      +
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class Api(__builtin__.object)
         A python interface into the Twitter API
      +  
      + By default, the Api caches results for 1 minute.
      +  
      + Example usage:
      +  
      +   To create an instance of the twitter.Api class, with no authentication:
      +  
      +     >>> import twitter
      +     >>> api = twitter.Api()
      +  
      +   To fetch a single user's public status messages, where "user" is either
      +   a Twitter "short name" or their user id.
      +  
      +     >>> statuses = api.GetUserTimeline(user)
      +     >>> print [s.text for s in statuses]
      +  
      +   To use authentication, instantiate the twitter.Api class with a
      +   consumer key and secret; and the oAuth key and secret:
      +  
      +     >>> api = twitter.Api(consumer_key='twitter consumer key',
      +                           consumer_secret='twitter consumer secret',
      +                           access_token_key='the_key_given',
      +                           access_token_secret='the_key_secret')
      +  
      +   To fetch your friends (after being authenticated):
      +  
      +     >>> users = api.GetFriends()
      +     >>> print [u.name for u in users]
      +  
      +   To post a twitter status message (after being authenticated):
      +  
      +     >>> status = api.PostUpdate('I love python-twitter!')
      +     >>> print status.text
      +     I love python-twitter!
      +  
      +   There are many other methods, including:
      +  
      +     >>> api.PostUpdates(status)
      +     >>> api.PostDirectMessage(user, text)
      +     >>> api.GetUser(user)
      +     >>> api.GetReplies()
      +     >>> api.GetUserTimeline(user)
      +     >>> api.GetStatus(id)
      +     >>> api.DestroyStatus(id)
      +     >>> api.GetFriends(user)
      +     >>> api.GetFollowers()
      +     >>> api.GetFeatured()
      +     >>> api.GetDirectMessages()
      +     >>> api.PostDirectMessage(user, text)
      +     >>> api.DestroyDirectMessage(id)
      +     >>> api.DestroyFriendship(user)
      +     >>> api.CreateFriendship(user)
      +     >>> api.VerifyCredentials()
       
       Methods defined here:
      +
      +
      ClearCredentials(self)
      +
      Clear the any credentials for this instance
      +
      + +
      +
      CreateFavorite(self, status)
      +
      Favorites the status specified in the status parameter as the authenticating user.
      + Returns the favorite status when successful.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   The twitter.Status instance to mark as a favorite.
      + Returns:
      +   A twitter.Status instance representing the newly-marked favorite.
      +
      +
      + +
      +
      CreateFriendship(self, user)
      +
      Befriends the user specified in the user parameter as the authenticating user.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   The ID or screen name of the user to befriend.
      + Returns:
      +   A twitter.User instance representing the befriended user.
      +
      +
      + +
      +
      CreateList(self, user, name, mode=None, description=None) +
      +
      Creates a new list with the given name
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user:
      +     Twitter name to create the list for
      +   name:
      +     New name for the list
      +   mode:
      +     'public' or 'private'.
      +     Defaults to 'public'. [Optional]
      +   description:
      +     Description of the list. [Optional]
      +  
      + Returns:
      +   A twitter.List instance representing the new list
      +
      +
      + +
      +
      CreateSubscription(self, owner, + list) +
      +
      Creates a subscription to a list by the authenticated user
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   owner:
      +     User name or id of the owner of the list being subscribed to.
      +   list:
      +     The slug or list id to subscribe the user to
      +  
      + Returns:
      +   A twitter.List instance representing the list subscribed to
      +
      +
      + +
      +
      DestroyDirectMessage(self, id) +
      +
      Destroys the direct message specified in the required ID parameter.
      +  
      + The twitter.Api instance must be authenticated, and the
      + authenticating user must be the recipient of the specified direct
      + message.
      +  
      + Args:
      +   id: The id of the direct message to be destroyed
      +  
      + Returns:
      +   A twitter.DirectMessage instance representing the message destroyed
      +
      +
      + +
      +
      DestroyFavorite(self, status)
      +
      Un-favorites the status specified in the ID parameter as the authenticating user.
      + Returns the un-favorited status in the requested format when successful.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   The twitter.Status to unmark as a favorite.
      + Returns:
      +   A twitter.Status instance representing the newly-unmarked favorite.
      +
      +
      + +
      +
      DestroyFriendship(self, user)
      +
      Discontinues friendship with the user specified in the user parameter.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   The ID or screen name of the user  with whom to discontinue friendship.
      + Returns:
      +   A twitter.User instance representing the discontinued friend.
      +
      +
      + +
      +
      DestroyList(self, user, id)
      +
      Destroys the list from the given user
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user:
      +     The user to remove the list from.
      +   id:
      +     The slug or id of the list to remove.
      + Returns:
      +   A twitter.List instance representing the removed list.
      +
      +
      + +
      +
      DestroyStatus(self, id)
      +
      Destroys the status specified by the required ID parameter.
      +  
      + The twitter.Api instance must be authenticated and the
      + authenticating user must be the author of the specified status.
      +  
      + Args:
      +   id:
      +     The numerical ID of the status you're trying to destroy.
      +  
      + Returns:
      +   A twitter.Status instance representing the destroyed status message
      +
      +
      + +
      +
      DestroySubscription(self, owner, + list) +
      +
      Destroys the subscription to a list for the authenticated user
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   owner:
      +     The user id or screen name of the user that owns the
      +     list that is to be unsubscribed from
      +   list:
      +     The slug or list id of the list to unsubscribe from
      +  
      + Returns:
      +   A twitter.List instance representing the removed list.
      +
      +
      + +
      +
      FilterPublicTimeline(self, term, + since_id=None) +
      +
      Filter the public twitter timeline by a given search term on
      + the local machine.
      +  
      + Args:
      +   term:
      +     term to search by.
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.Status instances, one for each message
      +   containing the term
      +
      + +
      +
      GetDirectMessages(self, since=None, since_id=None, page=None) +
      +
      Returns a list of the direct messages sent to the authenticating user.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   since:
      +     Narrows the returned results to just those statuses created
      +     after the specified HTTP-formatted date. [Optional]
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.DirectMessage instances
      +
      + +
      +
      GetFavorites(self, user=None, page=None) +
      +
      Return a list of Status objects representing favorited tweets.
      + By default, returns the (up to) 20 most recent tweets for the
      + authenticated user.
      +  
      + Args:
      +   user:
      +     The twitter name or id of the user whose favorites you are fetching.
      +     If not specified, defaults to the authenticated user. [Optional]
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +
      +
      + +
      +
      GetFeatured(self)
      +
      Fetch the sequence of twitter.User instances featured on twitter.com
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Returns:
      +   A sequence of twitter.User instances
      +
      +
      + +
      +
      GetFollowerIDs(self, userid=None, cursor=-1) +
      +
      Fetch the sequence of twitter.User instances, one for each follower
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Returns:
      +   A sequence of twitter.User instances, one for each follower
      +
      +
      + +
      +
      GetFollowers(self, page=None) +
      +
      Fetch the sequence of twitter.User instances, one for each follower
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.User instances, one for each follower
      +
      +
      + +
      +
      GetFriendIDs(self, user=None, cursor=-1) +
      +
      Returns a list of twitter user id's for every person
      + the specified user is following.
      +  
      + Args:
      +   user:
      +     The id or screen_name of the user to retrieve the id list for
      +     [Optional]
      +  
      + Returns:
      +   A list of integers, one for each user id.
      +
      +
      + +
      +
      GetFriends(self, user=None, cursor=-1) +
      +
      Fetch the sequence of twitter.User instances, one for each friend.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user:
      +     The twitter name or id of the user whose friends you are fetching.
      +     If not specified, defaults to the authenticated user. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.User instances, one for each friend
      +
      +
      + +
      +
      GetLists(self, user, cursor=-1) +
      +
      Fetch the sequence of lists for a user.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user:
      +     The twitter name or id of the user whose friends you are fetching.
      +     If the passed in user is the same as the authenticated user
      +     then you will also receive private list data.
      +   cursor:
      +     "page" value that Twitter will use to start building the
      +     list sequence from.  -1 to start at the beginning.
      +     Twitter will return in the result the values for next_cursor
      +     and previous_cursor. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.List instances, one for each list
      +
      +
      + +
      +
      GetMentions(self, since_id=None, max_id=None, page=None) +
      +
      Returns the 20 most recent mentions (status containing @twitterID)
      + for the authenticating user.
      +  
      + Args:
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +   max_id:
      +     Returns only statuses with an ID less than
      +     (that is, older than) the specified ID.  [Optional]
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.Status instances, one for each mention of the user.
      +
      +
      + +
      +
      GetRateLimitStatus(self)
      +
      Fetch the rate limit status for the currently authorized user.
      +  
      + Returns:
      +   A dictionary containing the time the limit will reset (reset_time),
      +   the number of remaining hits allowed before the reset (remaining_hits),
      +   the number of hits allowed in a 60-minute period (hourly_limit), and
      +   the time of the reset in seconds since The Epoch (reset_time_in_seconds).
      +
      +
      + +
      +
      GetReplies(self, since=None, since_id=None, page=None) +
      +
      Get a sequence of status messages representing the 20 most
      + recent replies (status updates prefixed with @twitterID) to the
      + authenticating user.
      +  
      + Args:
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +   since:
      +  
      + Returns:
      +   A sequence of twitter.Status instances, one for each reply to the user.
      +
      +
      + +
      +
      GetRetweets(self, statusid)
      +
      Returns up to 100 of the first retweets of the tweet identified
      + by statusid
      +  
      + Args:
      +   statusid:
      +     The ID of the tweet for which retweets should be searched for
      +  
      + Returns:
      +   A list of twitter.Status instances, which are retweets of statusid
      +
      +
      + +
      +
      GetSearch(self, term, geocode=None, since_id=None, + per_page=15, page=1, lang='en', show_user='true', + query_users=False) +
      +
      + Return twitter search results for a given term.
      +  
      + Args:
      +   term:
      +     term to search by.
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +   geocode:
      +     geolocation information in the form (latitude, longitude, radius)
      +     [Optional]
      +   per_page:
      +     number of results to return.  Default is 15 [Optional]
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +   lang:
      +     language for results.  Default is English [Optional]
      +   show_user:
      +     prefixes screen name in status
      +   query_users:
      +     If set to False, then all users only have screen_name and
      +     profile_image_url available.
      +     If set to True, all information of users are available,
      +     but it uses lots of request quota, one per status.
      +  
      + Returns:
      +   A sequence of twitter.Status instances, one for each message containing
      +   the term
      +
      + +
      +
      GetStatus(self, id)
      +
      Returns a single status message.
      +  
      + The twitter.Api instance must be authenticated if the
      + status message is private.
      +  
      + Args:
      +   id:
      +     The numeric ID of the status you are trying to retrieve.
      +  
      + Returns:
      +   A twitter.Status instance representing that status message
      +
      +
      + +
      +
      GetSubscriptions(self, user, + cursor=-1) +
      +
      Fetch the sequence of Lists that the given user is subscribed to
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user:
      +     The twitter name or id of the user
      +   cursor:
      +     "page" value that Twitter will use to start building the
      +     list sequence from.  -1 to start at the beginning.
      +     Twitter will return in the result the values for next_cursor
      +     and previous_cursor. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.List instances, one for each list
      +
      +
      + +
      +
      GetTrendsCurrent(self, exclude=None) +
      +
      Get the current top trending topics
      +  
      + Args:
      +   exclude:
      +     Appends the exclude parameter as a request parameter.
      +     Currently only exclude=hashtags is supported. [Optional]
      +  
      + Returns:
      +   A list with 10 entries. Each entry contains the twitter.
      +
      +
      + +
      +
      GetTrendsDaily(self, exclude=None, startdate=None) +
      +
      Get the current top trending topics for each hour in a given day
      +  
      + Args:
      +   startdate:
      +     The start date for the report.
      +     Should be in the format YYYY-MM-DD. [Optional]
      +   exclude:
      +     Appends the exclude parameter as a request parameter.
      +     Currently only exclude=hashtags is supported. [Optional]
      +  
      + Returns:
      +   A list with 24 entries. Each entry contains the twitter.
      +   Trend elements that were trending at the corresponding hour of the day.
      +
      +
      + +
      +
      GetTrendsWeekly(self, exclude=None, startdate=None) +
      +
      Get the top 30 trending topics for each day in a given week.
      +  
      + Args:
      +   startdate:
      +     The start date for the report.
      +     Should be in the format YYYY-MM-DD. [Optional]
      +   exclude:
      +     Appends the exclude parameter as a request parameter.
      +     Currently only exclude=hashtags is supported. [Optional]
      + Returns:
      +   A list with each entry contains the twitter.
      +   Trend elements of trending topics for the corrsponding day of the week
      +
      +
      + +
      +
      GetUser(self, user)
      +
      Returns a single user.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user: The twitter name or id of the user to retrieve.
      +  
      + Returns:
      +   A twitter.User instance representing that user
      +
      +
      + +
      +
      GetUserRetweets(self, count=None, since_id=None, + max_id=None, include_entities=False) +
      +
      Fetch the sequence of retweets made by a single user.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   count:
      +     The number of status messages to retrieve. [Optional]
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +   max_id:
      +     Returns results with an ID less than (that is, older than) or
      +     equal to the specified ID. [Optional]
      +   include_entities:
      +     If True, each tweet will include a node called "entities,".
      +     This node offers a variety of metadata about the tweet in a
      +     discreet structure, including: user_mentions, urls, and
      +     hashtags. [Optional]
      +  
      + Returns:
      +   A sequence of twitter.Status instances, one for each message up to count
      +
      +
      + +
      +
      GetUserTimeline(self, id=None, user_id=None, screen_name=None, since_id=None, + max_id=None, count=None, + page=None, include_rts=None, + include_entities=None) +
      +
      Fetch the sequence of public Status messages for a single user.
      +  
      + The twitter.Api instance must be authenticated if the user is private.
      +  
      + Args:
      +   id:
      +     Specifies the ID or screen name of the user for whom to return
      +     the user_timeline. [Optional]
      +   user_id:
      +     Specfies the ID of the user for whom to return the
      +     user_timeline. Helpful for disambiguating when a valid user ID
      +     is also a valid screen name. [Optional]
      +   screen_name:
      +     Specfies the screen name of the user for whom to return the
      +     user_timeline. Helpful for disambiguating when a valid screen
      +     name is also a user ID. [Optional]
      +   since_id:
      +     Returns results with an ID greater than (that is, more recent
      +     than) the specified ID. There are limits to the number of
      +     Tweets which can be accessed through the API. If the limit of
      +     Tweets has occured since the since_id, the since_id will be
      +     forced to the oldest ID available. [Optional]
      +   max_id:
      +     Returns only statuses with an ID less than (that is, older
      +     than) or equal to the specified ID. [Optional]
      +   count:
      +     Specifies the number of statuses to retrieve. May not be
      +     greater than 200.  [Optional]
      +   page:
      +     Specifies the page of results to retrieve.
      +     Note: there are pagination limits. [Optional]
      +   include_rts:
      +     If True, the timeline will contain native retweets (if they
      +     exist) in addition to the standard stream of tweets. [Optional]
      +   include_entities:
      +     If True, each tweet will include a node called "entities,".
      +     This node offers a variety of metadata about the tweet in a
      +     discreet structure, including: user_mentions, urls, and
      +     hashtags. [Optional]
      +  
      + Returns:
      +   A sequence of Status instances, one for each message up to count
      +
      +
      + +
      +
      MaximumHitFrequency(self)
      +
      Determines the minimum number of seconds that a program must wait
      + before hitting the server again without exceeding the rate_limit
      + imposed for the currently authenticated user.
      +  
      + Returns:
      +   The minimum second interval that a program must use so as to not
      +   exceed the rate_limit imposed for the user.
      +
      +
      + +
      +
      PostDirectMessage(self, user, text) +
      +
      Post a twitter direct message from the authenticated user
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user: The ID or screen name of the recipient user.
      +   text: The message text to be posted.  Must be less than 140 characters.
      +  
      + Returns:
      +   A twitter.DirectMessage instance representing the message posted
      +
      +
      + +
      +
      PostUpdate(self, status, + in_reply_to_status_id=None) +
      +
      Post a twitter status message from the authenticated user.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   status:
      +     The message text to be posted.
      +     Must be less than or equal to 140 characters.
      +   in_reply_to_status_id:
      +     The ID of an existing status that the status to be posted is
      +     in reply to.  This implicitly sets the in_reply_to_user_id
      +     attribute of the resulting status to the user ID of the
      +     message being replied to.  Invalid/missing status IDs will be
      +     ignored. [Optional]
      + Returns:
      +   A twitter.Status instance representing the message posted.
      +
      +
      + +
      +
      PostUpdates(self, status, + continuation=None, **kwargs) +
      +
      Post one or more twitter status messages from the authenticated user.
      +  
      + Unlike api.PostUpdate, this method will post multiple status updates
      + if the message is longer than 140 characters.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   status:
      +     The message text to be posted.
      +     May be longer than 140 characters.
      +   continuation:
      +     The character string, if any, to be appended to all but the
      +     last message.  Note that Twitter strips trailing '...' strings
      +     from messages.  Consider using the unicode \u2026 character
      +     (horizontal ellipsis) instead. [Defaults to None]
      +   **kwargs:
      +     See api.PostUpdate for a list of accepted parameters.
      +  
      + Returns:
      +   A of list twitter.Status instance representing the messages posted.
      +
      +
      + +
      +
      SetCache(self, cache)
      +
      Override the default cache.  Set to None to prevent caching.
      +  
      + Args:
      +   cache:
      +     An instance that supports the same API as the twitter._FileCache
      +
      +
      + +
      +
      SetCacheTimeout(self, cache_timeout) +
      +
      Override the default cache timeout.
      +  
      + Args:
      +   cache_timeout:
      +     Time, in seconds, that responses should be reused.
      +
      +
      + +
      +
      SetCredentials(self, consumer_key, + consumer_secret, access_token_key=None, access_token_secret=None) +
      +
      Set the consumer_key and consumer_secret for this instance
      +  
      + Args:
      +   consumer_key:
      +     The consumer_key of the twitter account.
      +   consumer_secret:
      +     The consumer_secret for the twitter account.
      +   access_token_key:
      +     The oAuth access token key value you retrieved
      +     from running get_access_token.py.
      +   access_token_secret:
      +     The oAuth access token's secret, also retrieved
      +     from the get_access_token.py run.
      +
      + +
      +
      SetSource(self, source)
      +
      Suggest the "from source" value to be displayed on the Twitter web site.
      +  
      + The value of the 'source' parameter must be first recognized by
      + the Twitter server.  New source values are authorized on a case by
      + case basis by the Twitter development team.
      +  
      + Args:
      +   source:
      +     The source name as a string.  Will be sent to the server as
      +     the 'source' parameter.
      +
      + +
      +
      SetUrllib(self, urllib)
      +
      Override the default urllib implementation.
      +  
      + Args:
      +   urllib:
      +     An instance that supports the same API as the urllib2 module
      +
      +
      + +
      +
      SetUserAgent(self, user_agent)
      +
      Override the default user agent
      +  
      + Args:
      +   user_agent:
      +     A string that should be send to the server as the User-agent
      +
      + +
      +
      SetXTwitterHeaders(self, client, + url, version) +
      +
      Set the X-Twitter HTTP headers that will be sent to the server.
      +  
      + Args:
      +   client:
      +      The client name as a string.  Will be sent to the server as
      +      the 'X-Twitter-Client' header.
      +   url:
      +      The URL of the meta.xml as a string.  Will be sent to the server
      +      as the 'X-Twitter-Client-URL' header.
      +   version:
      +      The client version as a string.  Will be sent to the server
      +      as the 'X-Twitter-Client-Version' header.
      +
      +
      + +
      +
      UsersLookup(self, user_id=None, screen_name=None, + users=None) +
      +
      + Fetch extended information for the specified users.
      +  
      + Users may be specified either as lists of either user_ids,
      + screen_names, or twitter.User objects. The list of users that
      + are queried is the union of all specified parameters.
      +  
      + The twitter.Api instance must be authenticated.
      +  
      + Args:
      +   user_id:
      +     A list of user_ids to retrieve extended information.
      +     [Optional]
      +   screen_name:
      +     A list of screen_names to retrieve extended information.
      +     [Optional]
      +   users:
      +     A list of twitter.User objects to retrieve extended information.
      +     [Optional]
      +  
      + Returns:
      +   A list of twitter.User objects for the requested users
      +
      +
      + +
      +
      VerifyCredentials(self)
      +
      Returns a twitter.User instance if the authenticating user is valid.
      +  
      + Returns:
      +   A twitter.User instance representing that user if the
      +   credentials are valid, None otherwise.
      +
      + +
      +
      __init__(self, consumer_key=None, consumer_secret=None, + access_token_key=None, access_token_secret=None, input_encoding=None, + request_headers=None, cache=<object + object at 0x1001da0a0>, shortner=None, + base_url=None, use_gzip_compression=False, + debugHTTP=False) +
      +
      Instantiate a new twitter.Api object.
      +  
      + Args:
      +   consumer_key:
      +     Your Twitter user's consumer_key.
      +   consumer_secret:
      +     Your Twitter user's consumer_secret.
      +   access_token_key:
      +     The oAuth access token key value you retrieved
      +     from running get_access_token.py.
      +   access_token_secret:
      +     The oAuth access token's secret, also retrieved
      +     from the get_access_token.py run.
      +   input_encoding:
      +     The encoding used to encode input strings. [Optional]
      +   request_header:
      +     A dictionary of additional HTTP request headers. [Optional]
      +   cache:
      +     The cache instance to use. Defaults to DEFAULT_CACHE.
      +     Use None to disable caching. [Optional]
      +   shortner:
      +     The shortner instance to use.  Defaults to None.
      +     See shorten_url.py for an example shortner. [Optional]
      +   base_url:
      +     The base URL to use to contact the Twitter API.
      +     Defaults to https://twitter.com. [Optional]
      +   use_gzip_compression:
      +     Set to True to tell enable gzip compression for any call
      +     made to Twitter.  Defaults to False. [Optional]
      +   debugHTTP:
      +     Set to True to enable debug output from urllib2 when performing
      +     any HTTP requests.  Defaults to False. [Optional]
      +
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      + Data and other attributes defined here:
      +
      +
      DEFAULT_CACHE_TIMEOUT = 60 +
      + +
      +

      + + + + + + + + + + + + + +
       
      + class DirectMessage(__builtin__.object)
         A class representing the DirectMessage structure used by the twitter API.
      +  
      + The DirectMessage structure exposes the following properties:
      +  
      +   direct_message.id
      +   direct_message.created_at
      +   direct_message.created_at_in_seconds # read only
      +   direct_message.sender_id
      +   direct_message.sender_screen_name
      +   direct_message.recipient_id
      +   direct_message.recipient_screen_name
      +   direct_message.text
       
       Methods defined here:
      +
      +
      AsDict(self)
      +
      A dict representation of this twitter.DirectMessage instance.
      +  
      + The return value uses the same key names as the JSON representation.
      +  
      + Return:
      +   A dict representing this twitter.DirectMessage instance
      +
      + +
      +
      AsJsonString(self)
      +
      A JSON string representation of this twitter.DirectMessage instance.
      +  
      + Returns:
      +   A JSON string representation of this twitter.DirectMessage instance
      +
      + +
      +
      GetCreatedAt(self)
      +
      Get the time this direct message was posted.
      +  
      + Returns:
      +   The time this direct message was posted
      +
      +
      + +
      +
      GetCreatedAtInSeconds(self) +
      +
      Get the time this direct message was posted, in seconds since the epoch.
      +  
      + Returns:
      +   The time this direct message was posted, in seconds since the epoch.
      +
      +
      + +
      +
      GetId(self)
      +
      Get the unique id of this direct message.
      +  
      + Returns:
      +   The unique id of this direct message
      +
      + +
      +
      GetRecipientId(self)
      +
      Get the unique recipient id of this direct message.
      +  
      + Returns:
      +   The unique recipient id of this direct message
      +
      +
      + +
      +
      + GetRecipientScreenName(self) +
      +
      Get the unique recipient screen name of this direct message.
      +  
      + Returns:
      +   The unique recipient screen name of this direct message
      +
      +
      + +
      +
      GetSenderId(self)
      +
      Get the unique sender id of this direct message.
      +  
      + Returns:
      +   The unique sender id of this direct message
      +
      +
      + +
      +
      GetSenderScreenName(self) +
      +
      Get the unique sender screen name of this direct message.
      +  
      + Returns:
      +   The unique sender screen name of this direct message
      +
      +
      + +
      +
      GetText(self)
      +
      Get the text of this direct message.
      +  
      + Returns:
      +   The text of this direct message.
      +
      + +
      +
      SetCreatedAt(self, created_at) +
      +
      Set the time this direct message was posted.
      +  
      + Args:
      +   created_at:
      +     The time this direct message was created
      +
      +
      + +
      +
      SetId(self, id)
      +
      Set the unique id of this direct message.
      +  
      + Args:
      +   id:
      +     The unique id of this direct message
      +
      +
      + +
      +
      SetRecipientId(self, + recipient_id) +
      +
      Set the unique recipient id of this direct message.
      +  
      + Args:
      +   recipient_id:
      +     The unique recipient id of this direct message
      +
      +
      + +
      +
      + SetRecipientScreenName(self, + recipient_screen_name) +
      +
      Set the unique recipient screen name of this direct message.
      +  
      + Args:
      +   recipient_screen_name:
      +     The unique recipient screen name of this direct message
      +
      +
      + +
      +
      SetSenderId(self, sender_id) +
      +
      Set the unique sender id of this direct message.
      +  
      + Args:
      +   sender_id:
      +     The unique sender id of this direct message
      +
      +
      + +
      +
      SetSenderScreenName(self, + sender_screen_name) +
      +
      Set the unique sender screen name of this direct message.
      +  
      + Args:
      +   sender_screen_name:
      +     The unique sender screen name of this direct message
      +
      +
      + +
      +
      SetText(self, text)
      +
      Set the text of this direct message.
      +  
      + Args:
      +   text:
      +     The text of this direct message
      +
      +
      + +
      +
      __eq__(self, other)
      +
      + +
      +
      __init__(self, id=None, created_at=None, + sender_id=None, sender_screen_name=None, + recipient_id=None, recipient_screen_name=None, text=None) +
      +
      An object to hold a Twitter direct message.
      +  
      + This class is normally instantiated by the twitter.Api class and
      + returned in a sequence.
      +  
      + Note: Dates are posted in the form "Sat Jan 27 04:17:38 +0000 2007"
      +  
      + Args:
      +   id:
      +     The unique id of this direct message. [Optional]
      +   created_at:
      +     The time this direct message was posted. [Optional]
      +   sender_id:
      +     The id of the twitter user that sent this message. [Optional]
      +   sender_screen_name:
      +     The name of the twitter user that sent this message. [Optional]
      +   recipient_id:
      +     The id of the twitter that received this message. [Optional]
      +   recipient_screen_name:
      +     The name of the twitter that received this message. [Optional]
      +   text:
      +     The text of this direct message. [Optional]
      +
      +
      + +
      +
      __ne__(self, other)
      +
      + +
      +
      __str__(self)
      +
      A string representation of this twitter.DirectMessage instance.
      +  
      + The return value is the same as the JSON string representation.
      +  
      + Returns:
      +   A string representation of this twitter.DirectMessage instance.
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data)
      +
      + Create a new instance based on a JSON dict.
      +  
      + Args:
      +   data:
      +     A JSON dict, as converted from the JSON in the twitter API
      +  
      + Returns:
      +   A twitter.DirectMessage instance
      +
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +
      created_at
      +
      The time this direct message was posted.
      +
      +
      +
      created_at_in_seconds
      +
      The time this direct message was posted, in seconds since the epoch +
      +
      +
      +
      id
      +
      The unique id of this direct message.
      +
      +
      +
      recipient_id
      +
      + The unique recipient id of this direct message. +
      +
      +
      +
      recipient_screen_name
      +
      The unique recipient screen name of this direct message. +
      +
      +
      +
      sender_id
      +
      The unique sender id of this direct message. +
      +
      +
      +
      sender_screen_name
      +
      The unique sender screen name of this direct message. +
      +
      +
      +
      text
      +
      The text of this direct message
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class + Hashtag(__builtin__.object)
         A class represeinting a twitter hashtag
       
      +
       Methods defined here:
      +
      +
      __init__(self, text=None) +
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data)
      +
      + Create a new instance based on a JSON dict.
      +  
      + Args:
      +   data:
      +     A JSON dict, as converted from the JSON in the twitter API
      +  
      + Returns:
      +   A twitter.Hashtag instance
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class List(__builtin__.object)
         A class representing the List structure used by the twitter API.
      +  
      + The List structure exposes the following properties:
      +  
      +   list.id
      +   list.name
      +   list.slug
      +   list.description
      +   list.full_name
      +   list.mode
      +   list.uri
      +   list.member_count
      +   list.subscriber_count
      +   list.following
       
       Methods defined here:
      +
      +
      AsDict(self)
      +
      A dict representation of this twitter.List instance.
      +  
      + The return value uses the same key names as the JSON representation.
      +  
      + Return:
      +   A dict representing this twitter.List instance
      +
      + +
      +
      AsJsonString(self)
      +
      A JSON string representation of this twitter.List instance.
      +  
      + Returns:
      +   A JSON string representation of this twitter.List instance
      +
      + +
      +
      GetDescription(self)
      +
      Get the description of this list.
      +  
      + Returns:
      +   The description of this list
      +
      + +
      +
      GetFollowing(self)
      +
      Get the following status of this list.
      +  
      + Returns:
      +   The following status of this list
      +
      + +
      +
      GetFull_name(self)
      +
      Get the full_name of this list.
      +  
      + Returns:
      +   The full_name of this list
      +
      + +
      +
      GetId(self)
      +
      Get the unique id of this list.
      +  
      + Returns:
      +   The unique id of this list
      +
      + +
      +
      GetMember_count(self)
      +
      Get the member_count of this list.
      +  
      + Returns:
      +   The member_count of this list
      +
      + +
      +
      GetMode(self)
      +
      Get the mode of this list.
      +  
      + Returns:
      +   The mode of this list
      +
      + +
      +
      GetName(self)
      +
      Get the real name of this list.
      +  
      + Returns:
      +   The real name of this list
      +
      + +
      +
      GetSlug(self)
      +
      Get the slug of this list.
      +  
      + Returns:
      +   The slug of this list
      +
      + +
      +
      GetSubscriber_count(self)
      +
      Get the subscriber_count of this list.
      +  
      + Returns:
      +   The subscriber_count of this list
      +
      + +
      +
      GetUri(self)
      +
      Get the uri of this list.
      +  
      + Returns:
      +   The uri of this list
      +
      + +
      +
      GetUser(self)
      +
      Get the user of this list.
      +  
      + Returns:
      +   The owner of this list
      +
      + +
      +
      SetDescription(self, description) +
      +
      Set the description of this list.
      +  
      + Args:
      +   description:
      +     The description of this list.
      +
      + +
      +
      SetFollowing(self, following)
      +
      Set the following status of this list.
      +  
      + Args:
      +   following:
      +     The following of this list.
      +
      + +
      +
      SetFull_name(self, full_name)
      +
      Set the full_name of this list.
      +  
      + Args:
      +   full_name:
      +     The full_name of this list.
      +
      + +
      +
      SetId(self, id)
      +
      Set the unique id of this list.
      +  
      + Args:
      +   id:
      +     The unique id of this list.
      +
      + +
      +
      SetMember_count(self, member_count) +
      +
      Set the member_count of this list.
      +  
      + Args:
      +   member_count:
      +     The member_count of this list.
      +
      + +
      +
      SetMode(self, mode)
      +
      Set the mode of this list.
      +  
      + Args:
      +   mode:
      +     The mode of this list.
      +
      + +
      +
      SetName(self, name)
      +
      Set the real name of this list.
      +  
      + Args:
      +   name:
      +     The real name of this list
      +
      + +
      +
      SetSlug(self, slug)
      +
      Set the slug of this list.
      +  
      + Args:
      +   slug:
      +     The slug of this list.
      +
      + +
      +
      SetSubscriber_count(self, + subscriber_count) +
      +
      Set the subscriber_count of this list.
      +  
      + Args:
      +   subscriber_count:
      +     The subscriber_count of this list.
      +
      + +
      +
      SetUri(self, uri)
      +
      Set the uri of this list.
      +  
      + Args:
      +   uri:
      +     The uri of this list.
      +
      + +
      +
      SetUser(self, user)
      +
      Set the user of this list.
      +  
      + Args:
      +   user:
      +     The owner of this list.
      +
      + +
      +
      __eq__(self, other)
      +
      + +
      +
      __init__(self, id=None, + name=None, slug=None, + description=None, full_name=None, mode=None, uri=None, member_count=None, + subscriber_count=None, following=None, user=None) +
      +
      + +
      +
      __ne__(self, other)
      +
      + +
      +
      __str__(self)
      +
      A string representation of this twitter.List instance.
      +  
      + The return value is the same as the JSON string representation.
      +  
      + Returns:
      +   A string representation of this twitter.List instance.
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data)
      +
      + Create a new instance based on a JSON dict.
      +  
      + Args:
      +   data:
      +     A JSON dict, as converted from the JSON in the twitter API
      +  
      + Returns:
      +   A twitter.List instance
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +
      description
      +
      The description of this list.
      +
      +
      +
      following
      +
      The following status of this list.
      +
      +
      +
      full_name
      +
      The full_name of this list.
      +
      +
      +
      id
      +
      The unique id of this list.
      +
      +
      +
      member_count
      +
      The member_count of this list.
      +
      +
      +
      mode
      +
      The mode of this list.
      +
      +
      +
      name
      +
      The real name of this list.
      +
      +
      +
      slug
      +
      The slug of this list.
      +
      +
      +
      subscriber_count
      +
      The subscriber_count of this list.
      +
      +
      +
      uri
      +
      The uri of this list.
      +
      +
      +
      user
      +
      The owner of this list.
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class Status(__builtin__.object)
         A class representing the Status structure used by the twitter API.
      +  
      + The Status structure exposes the following properties:
      +  
      +   status.created_at
      +   status.created_at_in_seconds # read only
      +   status.favorited
      +   status.in_reply_to_screen_name
      +   status.in_reply_to_user_id
      +   status.in_reply_to_status_id
      +   status.truncated
      +   status.source
      +   status.id
      +   status.text
      +   status.location
      +   status.relative_created_at # read only
      +   status.user
      +   status.urls
      +   status.user_mentions
      +   status.hashtags
       
       Methods defined here:
      +
      +
      AsDict(self)
      +
      A dict representation of this twitter.Status instance.
      +  
      + The return value uses the same key names as the JSON representation.
      +  
      + Return:
      +   A dict representing this twitter.Status instance
      +
      +
      + +
      +
      AsJsonString(self)
      +
      A JSON string representation of this twitter.Status instance.
      +  
      + Returns:
      +   A JSON string representation of this twitter.Status instance
      +
      + +
      +
      GetCreatedAt(self)
      +
      Get the time this status message was posted.
      +  
      + Returns:
      +   The time this status message was posted
      +
      +
      + +
      +
      GetCreatedAtInSeconds(self) +
      +
      Get the time this status message was posted, in seconds since the epoch.
      +  
      + Returns:
      +   The time this status message was posted, in seconds since the epoch.
      +
      +
      + +
      +
      GetFavorited(self)
      +
      Get the favorited setting of this status message.
      +  
      + Returns:
      +   True if this status message is favorited; False otherwise
      +
      +
      + +
      +
      GetId(self)
      +
      Get the unique id of this status message.
      +  
      + Returns:
      +   The unique id of this status message
      +
      + +
      +
      GetInReplyToScreenName(self) +
      +
      + +
      +
      GetInReplyToStatusId(self) +
      +
      + +
      +
      GetInReplyToUserId(self)
      +
      + +
      +
      GetLocation(self)
      +
      Get the geolocation associated with this status message
      +  
      + Returns:
      +   The geolocation string of this status message.
      +
      +
      + +
      +
      GetNow(self)
      +
      + Get the wallclock time for this status message.
      +  
      + Used to calculate relative_created_at.  Defaults to the time
      + the object was instantiated.
      +  
      + Returns:
      +   Whatever the status instance believes the current time to be,
      +   in seconds since the epoch.
      +
      + +
      +
      GetRelativeCreatedAt(self) +
      +
      Get a human redable string representing the posting time
      +  
      + Returns:
      +   A human readable string representing the posting time
      +
      +
      + +
      +
      GetSource(self)
      +
      + +
      +
      GetText(self)
      +
      Get the text of this status message.
      +  
      + Returns:
      +   The text of this status message.
      +
      + +
      +
      GetTruncated(self)
      +
      + +
      +
      GetUser(self)
      +
      Get a twitter.User reprenting the entity posting this status message.
      +  
      + Returns:
      +   A twitter.User reprenting the entity posting this status message
      +
      +
      + +
      +
      SetCreatedAt(self, created_at)
      +
      Set the time this status message was posted.
      +  
      + Args:
      +   created_at:
      +     The time this status message was created
      +
      +
      + +
      +
      SetFavorited(self, favorited)
      +
      + Set the favorited state of this status message.
      +  
      + Args:
      +   favorited:
      +     boolean True/False favorited state of this status message
      +
      +
      + +
      +
      SetId(self, id)
      +
      Set the unique id of this status message.
      +  
      + Args:
      +   id:
      +     The unique id of this status message
      +
      +
      + +
      +
      SetInReplyToScreenName(self, + in_reply_to_screen_name) +
      +
      + +
      +
      SetInReplyToStatusId(self, + in_reply_to_status_id) +
      +
      + +
      +
      SetInReplyToUserId(self, + in_reply_to_user_id) +
      +
      + +
      +
      SetLocation(self, location)
      +
      Set the geolocation associated with this status message
      +  
      + Args:
      +   location:
      +     The geolocation string of this status message
      +
      +
      + +
      +
      SetNow(self, now)
      +
      + Set the wallclock time for this status message.
      +  
      + Used to calculate relative_created_at.  Defaults to the time
      + the object was instantiated.
      +  
      + Args:
      +   now:
      +     The wallclock time for this instance.
      +
      +
      + +
      +
      SetSource(self, source)
      +
      + +
      +
      SetText(self, text)
      +
      Set the text of this status message.
      +  
      + Args:
      +   text:
      +     The text of this status message
      +
      +
      + +
      +
      SetTruncated(self, truncated)
      +
      + +
      +
      SetUser(self, user)
      +
      Set a twitter.User reprenting the entity posting this status message.
      +  
      + Args:
      +   user:
      +     A twitter.User reprenting the entity posting this status message
      +
      +
      + +
      +
      __eq__(self, other)
      +
      + +
      +
      __init__(self, created_at=None, favorited=None, id=None, text=None, location=None, user=None, + in_reply_to_screen_name=None, in_reply_to_user_id=None, in_reply_to_status_id=None, truncated=None, + source=None, now=None, + urls=None, user_mentions=None, + hashtags=None) +
      +
      An object to hold a Twitter status message.
      +  
      + This class is normally instantiated by the twitter.Api class and
      + returned in a sequence.
      +  
      + Note: Dates are posted in the form "Sat Jan 27 04:17:38 +0000 2007"
      +  
      + Args:
      +   created_at:
      +     The time this status message was posted. [Optiona]
      +   favorited:
      +     Whether this is a favorite of the authenticated user. [Optiona]
      +   id:
      +     The unique id of this status message. [Optiona]
      +   text:
      +     The text of this status message. [Optiona]
      +   location:
      +     the geolocation string associated with this message. [Optiona]
      +   relative_created_at:
      +     A human readable string representing the posting time. [Optiona]
      +   user:
      +     A twitter.User instance representing the person posting the
      +     message. [Optiona]
      +   now:
      +     The current time, if the client choses to set it.
      +     Defaults to the wall clock time. [Optiona]
      +
      +
      + +
      +
      __ne__(self, other)
      +
      + +
      +
      __str__(self)
      +
      A string representation of this twitter.Status instance.
      +  
      + The return value is the same as the JSON string representation.
      +  
      + Returns:
      +   A string representation of this twitter.Status instance.
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data)
      +
      + Create a new instance based on a JSON dict.
      +  
      + Args:
      +   data: A JSON dict, as converted from the JSON in the twitter API
      + Returns:
      +   A twitter.Status instance
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +
      created_at
      +
      The time this status message was posted.
      +
      +
      +
      created_at_in_seconds
      +
      The time this status message was posted, in seconds since the epoch +
      +
      +
      +
      favorited
      +
      The favorited state of this status message.
      +
      +
      +
      id
      +
      The unique id of this status message.
      +
      +
      +
      in_reply_to_screen_name
      +
      +
      +
      +
      in_reply_to_status_id
      +
      +
      +
      +
      in_reply_to_user_id
      +
      +
      +
      +
      location
      +
      The geolocation string of this status message +
      +
      +
      +
      now
      +
      The wallclock time for this status instance.
      +
      +
      +
      relative_created_at
      +
      Get a human readable string representing the posting time +
      +
      +
      +
      source
      +
      +
      +
      +
      text
      +
      The text of this status message
      +
      +
      +
      truncated
      +
      +
      +
      +
      user
      +
      A twitter.User reprenting the entity posting this status message +
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class + Trend(__builtin__.object) +
         A class representing a trending topic
       
       Methods defined here:
      +
      +
      __init__(self, name=None, + query=None, timestamp=None) +
      +
      + +
      +
      __str__(self)
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data, + timestamp=None) +
      +
      + Create a new instance based on a JSON dict
      +  
      + Args:
      +   data:
      +     A JSON dict
      +   timestamp:
      +     Gets set as the timestamp property of the new object
      +  
      + Returns:
      +   A twitter.Trend object
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class + TwitterError(exceptions.Exception)
         Base class for Twitter errors
       
        +
      +
      Method resolution order:
      +
      TwitterError
      +
      exceptions.Exception
      +
      exceptions.BaseException
      +
      __builtin__.object
      +
      +
      + Data descriptors defined here:
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +
      message
      +
      Returns the first argument used to construct this error. +
      +
      +
      + Methods inherited from exceptions.Exception:
      +
      +
      __init__(...)
      +
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature +
      +
      + +
      + Data and other attributes inherited from exceptions.Exception:
      +
      +
      __new__ = <built-in method __new__ of type object at 0x100119f80> +
      T.__new__(S, ...) -> a new object with type S, a subtype of T +
      + +
      + Methods inherited from exceptions.BaseException:
      +
      +
      __delattr__(...)
      +
      x.__delattr__('name') <==> del x.name +
      +
      + +
      +
      __getattribute__(...)
      +
      x.__getattribute__('name') <==> x.name +
      +
      + +
      +
      __getitem__(...)
      +
      x.__getitem__(y) <==> x[y] +
      +
      + +
      +
      __getslice__(...)
      +
      x.__getslice__(i, j) <==> x[i:j]
      +  
      + Use of negative indices is not supported.
      +
      + +
      +
      __reduce__(...)
      +
      + +
      +
      __repr__(...)
      +
      x.__repr__() <==> repr(x) +
      +
      + +
      +
      __setattr__(...)
      +
      x.__setattr__('name', value) <==> x.name = value +
      +
      + +
      +
      __setstate__(...)
      +
      + +
      +
      __str__(...)
      +
      x.__str__() <==> str(x) +
      +
      + +
      +
      __unicode__(...)
      +
      + +
      + Data descriptors inherited from exceptions.BaseException:
      +
      +
      __dict__
      +
      +
      +
      args
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class Url(__builtin__.object)
         A class representing an URL contained in a tweet
        +
       Methods defined here:
      +
      +
      __init__(self, url=None, + expanded_url=None) +
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data)
      +
      + Create a new instance based on a JSON dict.
      +  
      + Args:
      +   data:
      +     A JSON dict, as converted from the JSON in the twitter API
      +  
      + Returns:
      +   A twitter.Url instance
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +

      + + + + + + + + + + + + + +
       
      + class User(__builtin__.object)
         A class representing the User structure used by the twitter API.
      +  
      + The User structure exposes the following properties:
      +  
      +   user.id
      +   user.name
      +   user.screen_name
      +   user.location
      +   user.description
      +   user.profile_image_url
      +   user.profile_background_tile
      +   user.profile_background_image_url
      +   user.profile_sidebar_fill_color
      +   user.profile_background_color
      +   user.profile_link_color
      +   user.profile_text_color
      +   user.protected
      +   user.utc_offset
      +   user.time_zone
      +   user.url
      +   user.status
      +   user.statuses_count
      +   user.followers_count
      +   user.friends_count
      +   user.favourites_count
       
       Methods defined here:
      +
      +
      AsDict(self)
      +
      A dict representation of this twitter.User instance.
      +  
      + The return value uses the same key names as the JSON representation.
      +  
      + Return:
      +   A dict representing this twitter.User instance
      +
      + +
      +
      AsJsonString(self)
      +
      A JSON string representation of this twitter.User instance.
      +  
      + Returns:
      +   A JSON string representation of this twitter.User instance
      +
      + +
      +
      GetDescription(self)
      +
      Get the short text description of this user.
      +  
      + Returns:
      +   The short text description of this user
      +
      +
      + +
      +
      GetFavouritesCount(self)
      +
      Get the number of favourites for this user.
      +  
      + Returns:
      +   The number of favourites for this user.
      +
      +
      + +
      +
      GetFollowersCount(self)
      +
      Get the follower count for this user.
      +  
      + Returns:
      +   The number of users following this user.
      +
      +
      + +
      +
      GetFriendsCount(self)
      +
      Get the friend count for this user.
      +  
      + Returns:
      +   The number of users this user has befriended.
      +
      +
      + +
      +
      GetId(self)
      +
      Get the unique id of this user.
      +  
      + Returns:
      +   The unique id of this user
      +
      + +
      +
      GetLocation(self)
      +
      Get the geographic location of this user.
      +  
      + Returns:
      +   The geographic location of this user
      +
      + +
      +
      GetName(self)
      +
      Get the real name of this user.
      +  
      + Returns:
      +   The real name of this user
      +
      + +
      +
      GetProfileBackgroundColor(self) +
      +
      + +
      +
      + GetProfileBackgroundImageUrl(self) +
      +
      + +
      +
      GetProfileBackgroundTile(self) +
      +
      Boolean for whether to tile the profile background image.
      +  
      + Returns:
      +   True if the background is to be tiled, False if not, None if unset.
      +
      +
      + +
      +
      GetProfileImageUrl(self)
      +
      + Get the url of the thumbnail of this user.
      +  
      + Returns:
      +   The url of the thumbnail of this user
      +
      +
      + +
      +
      GetProfileLinkColor(self)
      +
      + +
      +
      + GetProfileSidebarFillColor(self) +
      +
      + +
      +
      GetProfileTextColor(self)
      +
      + +
      +
      GetProtected(self)
      +
      + +
      +
      GetScreenName(self)
      +
      Get the short twitter name of this user.
      +  
      + Returns:
      +   The short twitter name of this user
      +
      + +
      +
      GetStatus(self)
      +
      Get the latest twitter.Status of this user.
      +  
      + Returns:
      +   The latest twitter.Status of this user
      +
      +
      + +
      +
      GetStatusesCount(self)
      +
      Get the number of status updates for this user.
      +  
      + Returns:
      +   The number of status updates for this user.
      +
      +
      + +
      +
      GetTimeZone(self)
      +
      Returns the current time zone string for the user.
      +  
      + Returns:
      +   The descriptive time zone string for the user.
      +
      +
      + +
      +
      GetUrl(self)
      +
      Get the homepage url of this user.
      +  
      + Returns:
      +   The homepage url of this user
      +
      + +
      +
      GetUtcOffset(self)
      +
      + +
      +
      SetDescription(self, description) +
      +
      Set the short text description of this user.
      +  
      + Args:
      +   description: The short text description of this user
      +
      +
      + +
      +
      SetFavouritesCount(self, count) +
      +
      Set the favourite count for this user.
      +  
      + Args:
      +   count:
      +     The number of favourites for this user.
      +
      +
      + +
      +
      SetFollowersCount(self, count) +
      +
      Set the follower count for this user.
      +  
      + Args:
      +   count:
      +     The number of users following this user.
      +
      +
      + +
      +
      SetFriendsCount(self, count)
      +
      Set the friend count for this user.
      +  
      + Args:
      +   count:
      +     The number of users this user has befriended.
      +
      +
      + +
      +
      SetId(self, id)
      +
      Set the unique id of this user.
      +  
      + Args:
      +   id: The unique id of this user.
      +
      + +
      +
      SetLocation(self, location)
      +
      Set the geographic location of this user.
      +  
      + Args:
      +   location: The geographic location of this user
      +
      +
      + +
      +
      SetName(self, name)
      +
      Set the real name of this user.
      +  
      + Args:
      +   name: The real name of this user
      +
      + +
      +
      SetProfileBackgroundColor(self, + profile_background_color) +
      +
      + +
      +
      + SetProfileBackgroundImageUrl(self, + profile_background_image_url) +
      +
      + +
      +
      SetProfileBackgroundTile(self, + profile_background_tile) +
      +
      Set the boolean flag for whether to tile the profile background image.
      +  
      + Args:
      +   profile_background_tile: Boolean flag for whether to tile or not.
      +
      +
      + +
      +
      SetProfileImageUrl(self, + profile_image_url) +
      +
      + Set the url of the thumbnail of this user.
      +  
      + Args:
      +   profile_image_url: The url of the thumbnail of this user
      +
      +
      + +
      +
      SetProfileLinkColor(self, + profile_link_color) +
      +
      + +
      +
      + SetProfileSidebarFillColor(self, + profile_sidebar_fill_color) +
      +
      + +
      +
      SetProfileTextColor(self, + profile_text_color) +
      +
      + +
      +
      SetProtected(self, protected)
      +
      + +
      +
      SetScreenName(self, screen_name)
      +
      Set the short twitter name of this user.
      +  
      + Args:
      +   screen_name: the short twitter name of this user
      +
      +
      + +
      +
      SetStatus(self, status)
      +
      Set the latest twitter.Status of this user.
      +  
      + Args:
      +   status:
      +     The latest twitter.Status of this user
      +
      +
      + +
      +
      SetStatusesCount(self, count)
      +
      Set the status update count for this user.
      +  
      + Args:
      +   count:
      +     The number of updates for this user.
      +
      +
      + +
      +
      SetTimeZone(self, time_zone)
      +
      Sets the user's time zone string.
      +  
      + Args:
      +   time_zone:
      +     The descriptive time zone to assign for the user.
      +
      +
      + +
      +
      SetUrl(self, url)
      +
      Set the homepage url of this user.
      +  
      + Args:
      +   url: The homepage url of this user
      +
      + +
      +
      SetUtcOffset(self, utc_offset)
      +
      + +
      +
      __eq__(self, other)
      +
      + +
      +
      __init__(self, id=None, + name=None, screen_name=None, + location=None, description=None, profile_image_url=None, profile_background_tile=None, profile_background_image_url=None, + profile_sidebar_fill_color=None, + profile_background_color=None, profile_link_color=None, profile_text_color=None, protected=None, + utc_offset=None, time_zone=None, followers_count=None, + friends_count=None, statuses_count=None, + favourites_count=None, url=None, status=None) +
      +
      + +
      +
      __ne__(self, other)
      +
      + +
      +
      __str__(self)
      +
      A string representation of this twitter.User instance.
      +  
      + The return value is the same as the JSON string representation.
      +  
      + Returns:
      +   A string representation of this twitter.User instance.
      +
      + +
      + Static methods defined here:
      +
      +
      NewFromJsonDict(data)
      +
      + Create a new instance based on a JSON dict.
      +  
      + Args:
      +   data:
      +     A JSON dict, as converted from the JSON in the twitter API
      +  
      + Returns:
      +   A twitter.User instance
      +
      + +
      + Data descriptors defined here:
      +
      +
      __dict__
      +
      dictionary for instance variables (if defined)
      +
      +
      +
      __weakref__
      +
      list of weak references to the object (if defined) +
      +
      +
      +
      description
      +
      The short text description of this user.
      +
      +
      +
      favourites_count
      +
      The number of favourites for this user.
      +
      +
      +
      followers_count
      +
      The number of users following this user.
      +
      +
      +
      friends_count
      +
      The number of friends for this user.
      +
      +
      +
      id
      +
      The unique id of this user.
      +
      +
      +
      location
      +
      The geographic location of this user.
      +
      +
      +
      name
      +
      The real name of this user.
      +
      +
      +
      profile_background_color
      +
      +
      +
      profile_background_image_url
      +
      The url of the profile background of this user. +
      +
      +
      +
      profile_background_tile
      +
      + Boolean for whether to tile the background image. +
      +
      +
      +
      profile_image_url
      +
      The url of the thumbnail of this user.
      +
      +
      +
      profile_link_color
      +
      +
      +
      profile_sidebar_fill_color
      +
      +
      +
      profile_text_color
      +
      +
      +
      protected
      +
      +
      +
      screen_name
      +
      The short twitter name of this user.
      +
      +
      +
      status
      +
      The latest twitter.Status of this user.
      +
      +
      +
      statuses_count
      +
      The number of updates for this user.
      +
      +
      +
      time_zone
      +
      Returns the current time zone string for the user.
      +  
      + Returns:
      +   The descriptive time zone string for the user.
      +
      +
      +
      +
      url
      +
      The homepage url of this user.
      +
      +
      +
      utc_offset
      +
      +
      + + + +

      - - - - -
       
      -Functions
             
      md5 = openssl_md5(...)
      Returns a md5 hash object; optionally initialized with a string
      -

      + +  
      + Functions + + + +        +   + +

      +
      md5 = openssl_md5(...)
      +
      Returns a md5 hash object; optionally initialized with a string +
      +
      + + + +

      - - - - -
       
      -Data
             ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
      -AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize'
      -CHARACTER_LIMIT = 140
      -DEFAULT_CACHE = <object object at 0x1001da0a0>
      -REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
      -SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate'
      -__author__ = 'python-twitter@googlegroups.com'
      -__version__ = '0.8'

      + +  
      + Data + + + +        +   + ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
      + AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize'
      + CHARACTER_LIMIT = 140
      + DEFAULT_CACHE = <object object at 0x1001da0a0>
      + REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
      + SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate'
      + __author__ = 'python-twitter@googlegroups.com'
      + __version__ = '0.8' + + + +

      - - - - -
       
      -Author
             python-twitter@googlegroups.com
      - + +  
      + Author + + + +        +   + python-twitter@googlegroups.com + + + + diff --git a/doc/twitter.rst b/doc/twitter.rst new file mode 100644 index 00000000..331b82e9 --- /dev/null +++ b/doc/twitter.rst @@ -0,0 +1,38 @@ +Modules Documentation +===================== + + +API +---------------- + +.. automodule:: twitter.api + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: twitter.error + :members: + :undoc-members: + :show-inheritance: + +Models +--------------------- + +.. automodule:: twitter.models + :members: + :undoc-members: + :show-inheritance: + +.. automodule:: twitter.ratelimit + :members: + :undoc-members: + :show-inheritance: + + +Utilities +--------------------- + +.. automodule:: twitter.twitter_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/with_django.rst b/doc/with_django.rst new file mode 100644 index 00000000..a0006347 --- /dev/null +++ b/doc/with_django.rst @@ -0,0 +1,4 @@ +Using with Django +================= + +Additional template tags that expand tweet urls and urlize tweet text. See the django template tags available for use with python-twitter: https://github.com/radzhome/python-twitter-django-tags \ No newline at end of file diff --git a/examples/get_all_user_tweets.py b/examples/get_all_user_tweets.py new file mode 100644 index 00000000..96524250 --- /dev/null +++ b/examples/get_all_user_tweets.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +""" +Downloads all tweets from a given user. + +Uses twitter.Api.GetUserTimeline to retreive the last 3,200 tweets from a user. +Twitter doesn't allow retreiving more tweets than this through the API, so we get +as many as possible. + +t.py should contain the imported variables. +""" + +from __future__ import print_function + +import json +import sys + +import twitter +from t import ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET, CONSUMER_KEY, CONSUMER_SECRET + + +def get_tweets(api=None, screen_name=None): + timeline = api.GetUserTimeline(screen_name=screen_name, count=200) + earliest_tweet = min(timeline, key=lambda x: x.id).id + print("getting tweets before:", earliest_tweet) + + while True: + tweets = api.GetUserTimeline( + screen_name=screen_name, max_id=earliest_tweet, count=200 + ) + new_earliest = min(tweets, key=lambda x: x.id).id + + if not tweets or new_earliest == earliest_tweet: + break + else: + earliest_tweet = new_earliest + print("getting tweets before:", earliest_tweet) + timeline += tweets + + return timeline + + +if __name__ == "__main__": + api = twitter.Api( + CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET + ) + screen_name = sys.argv[1] + print(screen_name) + timeline = get_tweets(api=api, screen_name=screen_name) + + with open('examples/timeline.json', 'w+') as f: + for tweet in timeline: + f.write(json.dumps(tweet._json)) + f.write('\n') diff --git a/examples/shorten_url.py b/examples/shorten_url.py index 3401bec2..e07ee7a3 100755 --- a/examples/shorten_url.py +++ b/examples/shorten_url.py @@ -1,71 +1,147 @@ #!/usr/bin/env python -# -# Copyright 2007-2013 The Python-Twitter Developers -# + +# Copyright 2007-2016 The Python-Twitter Developers + # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# + +# http://www.apache.org/licenses/LICENSE-2.0 + # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -'''A class that defines the default URL Shortener. +# ---------------------------------------------------------------------- +# Change History +# +# 2010-05-16 +# TinyURL example and the idea for this comes from a bug filed by +# acolorado with patch provided by ghills. Class implementation +# was done by @bear. +# +# Issue #19: http://code.google.com/p/python-twitter/issues/detail?id=19 +# +# 2016-02-18 +# Updated example with code to demonstrate passing a status message through +# a shortener and then off to PostUpdate. Implemenation by @jeremylow from +# bug filed by @immanuelfactor +# +# Issue #298: https://github.com/bear/python-twitter/issues/298 -TinyURL is provided as the default and as an example. -''' +# ---------------------------------------------------------------------- +# This file demonstrates how to shorten all URLs contained within a Tweet +# by passing the tweet text to a shortener. In this case, we're using TinyURL +# since it does not require any real authentication for our purposes. If you +# are using a different service to shorten URLs, then you will need to modify +# the ShortenURL class to suit your needs. -import urllib +# Note that this example shortens all URLs contained within the Tweet text. +# To use this example, replace the W/X/Y/Zs with your keys obtained from +# Twitter, or uncomment the lines for getting an environment variable. If you +# are using a virtualenv on Linux, you can set environment variables in the +# ~/VIRTUALENVDIR/bin/activate script. - # Change History - # - # 2010-05-16 - # TinyURL example and the idea for this comes from a bug filed by - # acolorado with patch provided by ghills. Class implementation - # was done by bear. - # - # Issue 19 http://code.google.com/p/python-twitter/issues/detail?id=19 - # +# If you need assistance with obtaining keys from Twitter, see the instructions +# in doc/getting_started.rst. + + +import re +try: + from urllib.request import urlopen +except: + from urllib2 import urlopen + +from twitter import Api +from twitter.twitter_utils import URL_REGEXP class ShortenURL(object): - '''Helper class to make URL Shortener calls if/when required''' + """ A class that defines the default URL Shortener. + + TinyURL is provided as the default and as an example helper class to make + URL Shortener calls if/when required. """ + def __init__(self, userid=None, password=None): - '''Instantiate a new ShortenURL object - + """Instantiate a new ShortenURL object. TinyURL, which is used for this + example, does not require a userid or password, so you can try this + out without specifying either. + Args: userid: userid for any required authorization call [optional] password: password for any required authorization call [optional] - ''' - self.userid = userid + """ + self.userid = userid self.password = password def Shorten(self, - longURL): - '''Call TinyURL API and returned shortened URL result - + long_url): + """ Call TinyURL API and returned shortened URL result. + Args: - longURL: URL string to shorten - + long_url: URL string to shorten + Returns: The shortened URL as a string Note: - longURL is required and no checks are made to ensure completeness - ''' + long_url is required and no checks are made to ensure completeness + """ result = None - f = urllib.urlopen("http://tinyurl.com/api-create.php?url=%s" % longURL) + f = urlopen("http://tinyurl.com/api-create.php?url={0}".format( + long_url)) try: result = f.read() finally: f.close() - return result + # The following check is required for py2/py3 compatibility, since + # urlopen on py3 returns a bytes-object, and urlopen on py2 returns a + # string. + if isinstance(result, bytes): + return result.decode('utf8') + else: + return result + + +def _get_api(): + # Either specify a set of keys here or use os.getenv('CONSUMER_KEY') style + # assignment: + + CONSUMER_KEY = 'WWWWWWWW' + # CONSUMER_KEY = os.getenv("CONSUMER_KEY", None) + CONSUMER_SECRET = 'XXXXXXXX' + # CONSUMER_SECRET = os.getenv("CONSUMER_SECRET", None) + ACCESS_TOKEN = 'YYYYYYYY' + # ACCESS_TOKEN = os.getenv("ACCESS_TOKEN", None) + ACCESS_TOKEN_SECRET = 'ZZZZZZZZ' + # ACCESS_TOKEN_SECRET = os.getenv("ACCESS_TOKEN_SECRET", None) + + return Api(CONSUMER_KEY, + CONSUMER_SECRET, + ACCESS_TOKEN, + ACCESS_TOKEN_SECRET) + + +def PostStatusWithShortenedURL(status): + shortener = ShortenURL() + api = _get_api() + + # Find all URLs contained within the status message. Value of ``urls`` will + # be a list. + urls = re.findall(URL_REGEXP, status) + + for url in urls: + status = status.replace(url, shortener.Shorten(url), 1) + + api.PostUpdate(status) + + +if __name__ == '__main__': + PostStatusWithShortenedURL("this is a test: http://www.example.com/tests") diff --git a/examples/streaming/track_users.py b/examples/streaming/track_users.py new file mode 100644 index 00000000..faa37565 --- /dev/null +++ b/examples/streaming/track_users.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python + +# Copyright 2007-2016 The Python-Twitter Developers + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ---------------------------------------------------------------------- + +# This file demonstrates how to track mentions of a specific set of users in +# english language and archive those mentions to a local file. The output +# file will contain one JSON string per line per Tweet. + +# To use this example, replace the W/X/Y/Zs with your keys obtained from +# Twitter, or uncomment the lines for getting an environment variable. If you +# are using a virtualenv on Linux, you can set environment variables in the +# ~/VIRTUALENVDIR/bin/activate script. + +# If you need assistance with obtaining keys from Twitter, see the instructions +# in doc/getting_started.rst. + +import os +import json + +from twitter import Api + +# Either specify a set of keys here or use os.getenv('CONSUMER_KEY') style +# assignment: + +CONSUMER_KEY = 'WWWWWWWW' +# CONSUMER_KEY = os.getenv("CONSUMER_KEY", None) +CONSUMER_SECRET = 'XXXXXXXX' +# CONSUMER_SECRET = os.getenv("CONSUMER_SECRET", None) +ACCESS_TOKEN = 'YYYYYYYY' +# ACCESS_TOKEN = os.getenv("ACCESS_TOKEN", None) +ACCESS_TOKEN_SECRET = 'ZZZZZZZZ' +# ACCESS_TOKEN_SECRET = os.getenv("ACCESS_TOKEN_SECRET", None) + +# Users to watch for should be a list. This will be joined by Twitter and the +# data returned will be for any tweet mentioning: +# @twitter *OR* @twitterapi *OR* @support. +USERS = ['@twitter', + '@twitterapi', + '@support'] + +# Languages to filter tweets by is a list. This will be joined by Twitter +# to return data mentioning tweets only in the english language. +LANGUAGES = ['en'] + +# Since we're going to be using a streaming endpoint, there is no need to worry +# about rate limits. +api = Api(CONSUMER_KEY, + CONSUMER_SECRET, + ACCESS_TOKEN, + ACCESS_TOKEN_SECRET) + + +def main(): + with open('output.txt', 'a') as f: + # api.GetStreamFilter will return a generator that yields one status + # message (i.e., Tweet) at a time as a JSON dictionary. + for line in api.GetStreamFilter(track=USERS, languages=LANGUAGES): + f.write(json.dumps(line)) + f.write('\n') + + +if __name__ == '__main__': + main() diff --git a/examples/tweet.py b/examples/tweet.py index 56f39fa0..ae76b7d0 100755 --- a/examples/tweet.py +++ b/examples/tweet.py @@ -4,13 +4,20 @@ __author__ = 'dewitt@google.com' -import ConfigParser +from __future__ import print_function + +try: + import configparser +except ImportError as _: + import ConfigParser as configparser + import getopt import os import sys import twitter + USAGE = '''Usage: tweet [options] message This script posts a message to Twitter. @@ -46,96 +53,104 @@ ''' + def PrintUsageAndExit(): - print USAGE - sys.exit(2) + print(USAGE) + sys.exit(2) + def GetConsumerKeyEnv(): - return os.environ.get("TWEETUSERNAME", None) + return os.environ.get("TWEETUSERNAME", None) + def GetConsumerSecretEnv(): - return os.environ.get("TWEETPASSWORD", None) + return os.environ.get("TWEETPASSWORD", None) + def GetAccessKeyEnv(): - return os.environ.get("TWEETACCESSKEY", None) + return os.environ.get("TWEETACCESSKEY", None) + def GetAccessSecretEnv(): - return os.environ.get("TWEETACCESSSECRET", None) + return os.environ.get("TWEETACCESSSECRET", None) + class TweetRc(object): - def __init__(self): - self._config = None + def __init__(self): + self._config = None - def GetConsumerKey(self): - return self._GetOption('consumer_key') + def GetConsumerKey(self): + return self._GetOption('consumer_key') - def GetConsumerSecret(self): - return self._GetOption('consumer_secret') + def GetConsumerSecret(self): + return self._GetOption('consumer_secret') - def GetAccessKey(self): - return self._GetOption('access_key') + def GetAccessKey(self): + return self._GetOption('access_key') - def GetAccessSecret(self): - return self._GetOption('access_secret') + def GetAccessSecret(self): + return self._GetOption('access_secret') - def _GetOption(self, option): - try: - return self._GetConfig().get('Tweet', option) - except: - return None + def _GetOption(self, option): + try: + return self._GetConfig().get('Tweet', option) + except: + return None + + def _GetConfig(self): + if not self._config: + self._config = configparser.ConfigParser() + self._config.read(os.path.expanduser('~/.tweetrc')) + return self._config - def _GetConfig(self): - if not self._config: - self._config = ConfigParser.ConfigParser() - self._config.read(os.path.expanduser('~/.tweetrc')) - return self._config def main(): - try: - shortflags = 'h' - longflags = ['help', 'consumer-key=', 'consumer-secret=', - 'access-key=', 'access-secret=', 'encoding='] - opts, args = getopt.gnu_getopt(sys.argv[1:], shortflags, longflags) - except getopt.GetoptError: - PrintUsageAndExit() - consumer_keyflag = None - consumer_secretflag = None - access_keyflag = None - access_secretflag = None - encoding = None - for o, a in opts: - if o in ("-h", "--help"): - PrintUsageAndExit() - if o in ("--consumer-key"): - consumer_keyflag = a - if o in ("--consumer-secret"): - consumer_secretflag = a - if o in ("--access-key"): - access_keyflag = a - if o in ("--access-secret"): - access_secretflag = a - if o in ("--encoding"): - encoding = a - message = ' '.join(args) - if not message: - PrintUsageAndExit() - rc = TweetRc() - consumer_key = consumer_keyflag or GetConsumerKeyEnv() or rc.GetConsumerKey() - consumer_secret = consumer_secretflag or GetConsumerSecretEnv() or rc.GetConsumerSecret() - access_key = access_keyflag or GetAccessKeyEnv() or rc.GetAccessKey() - access_secret = access_secretflag or GetAccessSecretEnv() or rc.GetAccessSecret() - if not consumer_key or not consumer_secret or not access_key or not access_secret: - PrintUsageAndExit() - api = twitter.Api(consumer_key=consumer_key, consumer_secret=consumer_secret, - access_token_key=access_key, access_token_secret=access_secret, - input_encoding=encoding) - try: - status = api.PostUpdate(message) - except UnicodeDecodeError: - print "Your message could not be encoded. Perhaps it contains non-ASCII characters? " - print "Try explicitly specifying the encoding with the --encoding flag" - sys.exit(2) - print "%s just posted: %s" % (status.user.name, status.text) + try: + shortflags = 'h' + longflags = ['help', 'consumer-key=', 'consumer-secret=', + 'access-key=', 'access-secret=', 'encoding='] + opts, args = getopt.gnu_getopt(sys.argv[1:], shortflags, longflags) + except getopt.GetoptError: + PrintUsageAndExit() + consumer_keyflag = None + consumer_secretflag = None + access_keyflag = None + access_secretflag = None + encoding = None + for o, a in opts: + if o in ("-h", "--help"): + PrintUsageAndExit() + if o in ("--consumer-key"): + consumer_keyflag = a + if o in ("--consumer-secret"): + consumer_secretflag = a + if o in ("--access-key"): + access_keyflag = a + if o in ("--access-secret"): + access_secretflag = a + if o in ("--encoding"): + encoding = a + message = ' '.join(args) + if not message: + PrintUsageAndExit() + rc = TweetRc() + consumer_key = consumer_keyflag or GetConsumerKeyEnv() or rc.GetConsumerKey() + consumer_secret = consumer_secretflag or GetConsumerSecretEnv() or rc.GetConsumerSecret() + access_key = access_keyflag or GetAccessKeyEnv() or rc.GetAccessKey() + access_secret = access_secretflag or GetAccessSecretEnv() or rc.GetAccessSecret() + if not consumer_key or not consumer_secret or not access_key or not access_secret: + PrintUsageAndExit() + api = twitter.Api(consumer_key=consumer_key, consumer_secret=consumer_secret, + access_token_key=access_key, access_token_secret=access_secret, + input_encoding=encoding) + try: + status = api.PostUpdate(message) + except UnicodeDecodeError: + print("Your message could not be encoded. Perhaps it contains non-ASCII characters? ") + print("Try explicitly specifying the encoding with the --encoding flag") + sys.exit(2) + + print("{0} just posted: {1}".format(status.user.name, status.text)) if __name__ == "__main__": - main() + main() diff --git a/examples/twitter-to-xhtml.py b/examples/twitter-to-xhtml.py index 8a386fd5..57b38470 100755 --- a/examples/twitter-to-xhtml.py +++ b/examples/twitter-to-xhtml.py @@ -1,69 +1,75 @@ #!/usr/bin/env python -'''Load the latest update for a Twitter user and leave it in an XHTML fragment''' +# Copyright 2007-2016 The Python-Twitter Developers +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -__author__ = 'dewitt@google.com' +# ------------------------------------------------------------------------ +# Load the latest update for a Twitter user and output it as an HTML fragment +# +from __future__ import print_function import codecs -import getopt import sys +import argparse + import twitter +from t import * + +__author__ = 'dewitt@google.com' + TEMPLATE = """ -