├── .circleci ├── config.yml └── images │ └── Dockerfile ├── .gitignore ├── AUTHORS.rst ├── CHANGES ├── COPYING ├── GAE.rst ├── LICENSE ├── MANIFEST.in ├── Makefile ├── NOTICE ├── README.rst ├── coveragerc ├── doc ├── Makefile ├── changelog.rst ├── changes_to_tweet_counting.rst ├── conf.py ├── contributing.rst ├── getting_started.rst ├── index.rst ├── installation.rst ├── make.bat ├── migration_v30.rst ├── models.rst ├── modules.rst ├── python-twitter-app-creation-part1.png ├── python-twitter-app-creation-part2-new.png ├── python-twitter-app-creation-part2.png ├── python-twitter-app-creation-part3-1-new.png ├── python-twitter-app-creation-part3-new.png ├── python-twitter-app-creation-part3.png ├── rate_limits.rst ├── searching.rst ├── twitter.html ├── twitter.rst └── with_django.rst ├── examples ├── get_all_user_tweets.py ├── shorten_url.py ├── streaming │ └── track_users.py ├── tweet.py ├── twitter-to-xhtml.py └── view_friends.py ├── get_access_token.py ├── pytest.ini ├── requirements.docs.txt ├── requirements.testing.txt ├── requirements.txt ├── setup.cfg ├── setup.py ├── test.py ├── testdata ├── 168NQ.jpg ├── 3.2 │ ├── extended_tweet_in_compat_mode.json │ └── extended_tweet_in_extended_mode.json ├── corgi.gif ├── create_friendship.json ├── destroy_friendship.json ├── direct_message-destroy.json ├── direct_messages-new.json ├── direct_messages.json ├── direct_messages │ ├── get_direct_messages.json │ ├── get_direct_messages_show.json │ ├── get_sent_direct_messages.json │ ├── post_destroy_direct_message.json │ └── post_post_direct_message.json ├── featured.json ├── followers.json ├── friends.json ├── friends_timeline-kesuke.json ├── friendship-create.json ├── friendship-destroy.json ├── get_blocks_0.json ├── get_blocks_1.json ├── get_blocks_ids_0.json ├── get_blocks_ids_1.json ├── get_favorites.json ├── get_follower_ids.json ├── get_follower_ids_0.json ├── get_follower_ids_1.json ├── get_follower_ids_paged.json ├── get_follower_ids_stringify.json ├── get_followers_0.json ├── get_followers_1.json ├── get_friend_ids_0.json ├── get_friend_ids_1.json ├── get_friends.json ├── get_friends_0.json ├── get_friends_1.json ├── get_friends_2.json ├── get_friends_3.json ├── get_friends_4.json ├── get_friends_ids.json ├── get_friends_paged.json ├── get_friends_paged_additional_params.json ├── get_friends_paged_uid.json ├── get_friendships_lookup_muting.json ├── get_friendships_lookup_muting_blocking.json ├── get_friendships_lookup_none.json ├── get_get_memberships.json ├── get_get_memberships_himawari8bot.json ├── get_get_subscriptions.json ├── get_get_subscriptions_uid.json ├── get_help_configuration.json ├── get_home_timeline.json ├── get_incoming_friendships.json ├── get_list_members.json ├── get_list_members_0.json ├── get_list_members_1.json ├── get_list_members_extra_params.json ├── get_list_timeline.json ├── get_list_timeline_count.json ├── get_list_timeline_count_rts_ent.json ├── get_list_timeline_id.json ├── get_list_timeline_max_since.json ├── get_lists.json ├── get_lists_list.json ├── get_lists_list_screen_name.json ├── get_lists_list_user_id.json ├── get_memberships.json ├── get_mentions.json ├── get_mutes_users_ids.json ├── get_mutes_users_ids_loop_0.json ├── get_mutes_users_ids_loop_1.json ├── get_mutes_users_list.json ├── get_mutes_users_list_loop_0.json ├── get_mutes_users_list_loop_1.json ├── get_outgoing_friendships.json ├── get_replies.json ├── get_retweeters.json ├── get_retweets.json ├── get_retweets_count.json ├── get_retweets_of_me.json ├── get_search.json ├── get_search_geocode.json ├── get_search_raw.json ├── get_show_friendship.json ├── get_show_subscription.json ├── get_show_subscription_extra_params.json ├── get_show_subscription_not_subscriber.json ├── get_status.json ├── get_status_ext_alt.json ├── get_status_extra_params.json ├── get_status_oembed.json ├── get_status_promoted_video_tweet.json ├── get_status_with_place.json ├── get_statuses.1.json ├── get_statuses.2.json ├── get_statuses.ids.txt ├── get_statuses.map.1.json ├── get_statuses.map.2.json ├── get_trends_current.json ├── get_trends_current_unicode.json ├── get_trends_woeid.json ├── get_trends_woeid_exclude.json ├── get_user.json ├── get_user_retweets.json ├── get_user_suggestion.json ├── get_user_suggestion_categories.json ├── get_user_timeline.json ├── get_user_timeline_count.json ├── get_user_timeline_sincemax.json ├── get_users_search.json ├── get_verify_credentials_include_email.json ├── lookup_friendship.json ├── media │ └── happy.jpg ├── models │ ├── models_category.json │ ├── models_direct_message.json │ ├── models_direct_message_short.json │ ├── models_hashtag.json │ ├── models_list.json │ ├── models_media.json │ ├── models_status.json │ ├── models_status_no_user.json │ ├── models_trend.json │ ├── models_url.json │ ├── models_user.json │ ├── models_user_status.json │ ├── status_quoted_tweet.json │ └── status_quoted_tweet_with_media.json ├── post_blocks_create.json ├── post_blocks_destroy.json ├── post_create_favorite.json ├── post_create_list.json ├── post_create_lists_member.json ├── post_create_lists_member_multiple.json ├── post_create_subscription.json ├── post_destroy_direct_message.json ├── post_destroy_favorite.json ├── post_destroy_list.json ├── post_destroy_lists_member.json ├── post_destroy_lists_member_multiple.json ├── post_destroy_status.json ├── post_destroy_subscription.json ├── post_media.json ├── post_mutes_users_create.json ├── post_mutes_users_create_skip_status.json ├── post_mutes_users_destroy.json ├── post_post_direct_message.json ├── post_retweet.json ├── post_update.json ├── post_update_extra_params.json ├── post_update_media_id.json ├── post_update_with_media.json ├── post_update_with_place.json ├── post_upload_chunked_FINAL.json ├── post_upload_chunked_INIT.json ├── post_upload_media_simple.json ├── public_timeline.json ├── public_timeline_error.json ├── ratelimit.json ├── replies.json ├── retweet.json ├── retweets_of_me.json ├── show-89512102.json ├── show-dewitt.json ├── status-destroy.json ├── streaming │ ├── lines.json │ └── streaming_extended_tweet.json ├── subs.srt ├── update.json ├── update_friendship.json ├── update_latlong.json ├── update_profile.json ├── user_timeline-kesuke.json ├── user_timeline.json ├── users_lookup.json └── verify_credentials.json ├── tests ├── __init__.py ├── test_api_30.py ├── test_direct_messages.py ├── test_error_handling.py ├── test_filecache.py ├── test_friendship.py ├── test_media.py ├── test_models.py ├── test_parse_tweet.py ├── test_place.py ├── test_rate_limit.py ├── test_searching.py ├── test_status.py ├── test_status_place.py ├── test_streaming.py ├── test_trend.py ├── test_tweet_changes.py ├── test_tweet_length.py ├── test_twitter_utils.py ├── test_unicode.py ├── test_url_regex.py └── test_user.py ├── tox.ini └── twitter ├── __init__.py ├── _file_cache.py ├── api.py ├── error.py ├── models.py ├── parse_tweet.py ├── ratelimit.py └── twitter_utils.py /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: ~/repo 5 | docker: 6 | - image: jeremylow/python-twitter 7 | steps: 8 | - checkout 9 | - run: sudo chown -R circleci:circleci ~/repo 10 | - run: 11 | name: set up pyenv 12 | command: pyenv local 2.7.15 3.7.1 pypy-5.7.1 pypy3.5-6.0.0 13 | - run: 14 | name: install deps 15 | command: pip install -r requirements.testing.txt 16 | - run: 17 | name: run tests 18 | command: | 19 | export PATH=/home/circleci/.local/bin:$PATH 20 | make tox 21 | -------------------------------------------------------------------------------- /.circleci/images/Dockerfile: -------------------------------------------------------------------------------- 1 | # We could use a smaller image, but this ensures that everything CircleCI needs 2 | # is installed already. 3 | FROM circleci/python:3.6 4 | MAINTAINER Jeremy Low 5 | 6 | # These are the version of python currently supported. 7 | ENV SUPPORTED_VERSIONS="2.7.15 3.7.1 pypy-5.7.1 pypy3.5-6.0.0" 8 | ENV PYENV_ROOT /home/circleci/.pyenv 9 | ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH 10 | 11 | # Get and install pyenv. 12 | RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash 13 | 14 | # pyenv installer doesn't set these for us. 15 | RUN echo "export PATH=${PYENV_ROOT}/bin:$$PATH \n\ 16 | eval '\$(pyenv init -)' \n\ 17 | eval '\$(pyenv virtualenv-init -)'" >> ~/.bashrc 18 | RUN pyenv update 19 | 20 | # Install each supported version into the container. 21 | RUN for i in $SUPPORTED_VERSIONS; do pyenv install "$i"; done 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[co] 2 | 3 | #small test code that contains my keys 4 | t.py 5 | 6 | # Packages 7 | *.egg 8 | *.egg-info 9 | dist 10 | build 11 | eggs 12 | parts 13 | bin 14 | include 15 | lib 16 | local 17 | var 18 | sdist 19 | develop-eggs 20 | .installed.cfg 21 | .eggs 22 | .cache 23 | .vscode 24 | 25 | # Installer logs 26 | pip-log.txt 27 | 28 | # Unit test / coverage reports 29 | .coverage 30 | .codecov-token 31 | .tox 32 | htmlcov 33 | .tox 34 | nosetests.xml 35 | htmlcov 36 | coverage.xml 37 | .hypothesis 38 | 39 | # PyCharm data 40 | .idea 41 | 42 | #Translations 43 | *.mo 44 | 45 | #Mr Developer 46 | .mr.developer.cfg 47 | 48 | #Environment 49 | env 50 | .python-version 51 | 52 | violations.flake8.txt 53 | 54 | # Built docs 55 | doc/_build/** 56 | 57 | # Mypy cache 58 | **/.mypy_cache 59 | 60 | # VS Code 61 | **/.vscode 62 | -------------------------------------------------------------------------------- /AUTHORS.rst: -------------------------------------------------------------------------------- 1 | Originally two libraries by DeWitt Clinton and Mike Taylor which was then merged into python-twitter. 2 | 3 | Now it's a full-on open source project with many contributors over time: 4 | 5 | * Jodok Batlogg, 6 | * Kyle Bock, 7 | * Brad Choate, 8 | * Robert Clarke, 9 | * Jim Cortez, 10 | * Pierre-Jean Coudert, 11 | * Aish Raj Dahal, 12 | * Thomas Dyson, 13 | * Jim Easterbrook 14 | * Yoshinori Fukushima, 15 | * Hameedullah Khan, 16 | * Osama Khalid, 17 | * Omar Kilani, 18 | * Domen Kožar, 19 | * Robert Laquey, 20 | * Jason Lemoine, 21 | * Pradeep Nayak, 22 | * Ian Ozsvald, 23 | * Nicolas Perriault, 24 | * Trevor Prater, 25 | * Glen Tregoning, 26 | * Lars Weiler, 27 | * Sebastian Wiesinger, 28 | * Jake Robinson, 29 | * Muthu Annamalai, 30 | * abloch, 31 | * cahlan, 32 | * dpslwk, 33 | * edleaf, 34 | * ecesena, 35 | * git-matrix, 36 | * sbywater, 37 | * thefinn93, 38 | * themylogin, 39 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2007-2014 The Python-Twitter Developers 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /GAE.rst: -------------------------------------------------------------------------------- 1 | ================================================ 2 | How to use python-twitter with Google App Engine 3 | ================================================ 4 | 5 | ********** 6 | Background 7 | ********** 8 | 9 | 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. 10 | 11 | 12 | ************* 13 | Prerequisites 14 | ************* 15 | 16 | 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: 17 | 18 | | myapp/ 19 | | ├── twitter/ 20 | | ├── requests_oauthlib/ 21 | | ├── requests_toolbelt/ 22 | | ├── main.py 23 | | └── app.yaml 24 | 25 | 26 | ******** 27 | app.yaml 28 | ******** 29 | 30 | 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: 31 | 32 | | libraries: 33 | | - name: jinja2 34 | | version: latest 35 | | - name: webapp2 36 | | version: latest 37 | | - name: ssl 38 | | version: latest 39 | 40 | 41 | **************************** 42 | Limitations & Considerations 43 | **************************** 44 | 45 | Caching 46 | ^^^^^^^ 47 | 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. 48 | 49 | Datastore 50 | ^^^^^^^^^ 51 | 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. 52 | 53 | Sockets 54 | ^^^^^^^^^ 55 | 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. 56 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CHANGES 2 | include COPYING 3 | include LICENSE 4 | include NOTICE 5 | include *.rst 6 | include requirements.txt 7 | prune .DS_Store 8 | graft doc examples testdata tests 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SUPPORTED_VERSIONS = 2.7.15 3.6.5 pypy-5.7.1 pypy3.5-6.0.0 2 | 3 | help: 4 | @echo " env install all production dependencies" 5 | @echo " dev install all dev and production dependencies (virtualenv is assumed)" 6 | @echo " docs build documentation" 7 | @echo " clean remove unwanted stuff" 8 | @echo " lint check style with flake8" 9 | @echo " test run tests" 10 | @echo " coverage run tests with code coverage" 11 | 12 | env: 13 | pip install -Ur requirements.txt 14 | 15 | pyenv: 16 | for version in $(SUPPORTED_VERSIONS) ; do \ 17 | pyenv install -s $$version; \ 18 | done 19 | pyenv local $(SUPPORTED_VERSIONS) 20 | 21 | dev: pyenv env 22 | pip install -Ur requirements.testing.txt 23 | 24 | info: 25 | @python --version 26 | @pyenv --version 27 | @pip --version 28 | 29 | clean: 30 | rm -fr build 31 | rm -fr dist 32 | find . -name '*.pyc' -exec rm -f {} \; 33 | find . -name '*.pyo' -exec rm -f {} \; 34 | find . -name '*~' ! -name '*.un~' -exec rm -f {} \; 35 | 36 | docs: 37 | $(MAKE) -C doc html 38 | 39 | lint: 40 | pycodestyle --config={toxinidir}/setup.cfg twitter tests 41 | 42 | test: lint 43 | pytest -s 44 | #python setup.py test 45 | 46 | tox: clean 47 | tox 48 | 49 | coverage: clean 50 | coverage run --source=twitter setup.py test --addopts "--ignore=venv" 51 | coverage html 52 | coverage report 53 | 54 | update-pyenv: 55 | cd /opt/circleci/.pyenv/plugins/python-build/../.. && git pull && cd - 56 | 57 | ci: update-pyenv pyenv dev tox 58 | CODECOV_TOKEN=`cat .codecov-token` codecov 59 | 60 | build: clean 61 | python setup.py check 62 | python setup.py sdist 63 | python setup.py bdist_wheel 64 | 65 | upload: clean 66 | pyenv 2.7.15 67 | python setup.py sdist upload 68 | python setup.py bdist_wheel upload 69 | pyenv 3.6.5 70 | python setup.py bdist_wheel upload 71 | pyenv local $(SUPPORTED_VERSIONS) 72 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | NOTICE 2 | 3 | This code is made available under the Apache License and is copyright the Python-Twitter Developers. 4 | -------------------------------------------------------------------------------- /coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = twitter 3 | -------------------------------------------------------------------------------- /doc/changes_to_tweet_counting.rst: -------------------------------------------------------------------------------- 1 | REST API Changes 2 | ================= 3 | 4 | Information compiled on Sept 14, 2016. 5 | 6 | ``statuses/update`` Endpoint 7 | ---------------------------- 8 | 9 | ``auto_populate_reply_metadata`` 10 | +++++++++++++++++++++++++++++++ 11 | 12 | * Default is ``false`` 13 | 14 | * Must have ``in_reply_to_status_id`` set. 15 | 16 | * Unknown what happens if not set. Probably error (does it get posted?) 17 | 18 | * If the status to which you're replying is deleted, tweet will fail to post. 19 | 20 | ``exclude_reply_user_ids`` 21 | ++++++++++++++++++++++++++ 22 | 23 | * List of ``user_ids`` to remove from result of ``auto_populate_reply_metadata``. 24 | 25 | * Doesn't apply to the first ``user_id``. 26 | 27 | * If you try to remove it, this will be silently ignored by Twitter. 28 | 29 | ``attachment_url`` 30 | ++++++++++++++++++ 31 | 32 | * Must be a status permalnk or a DM deep link. 33 | 34 | * If it's anything else and included in this parameter, Twitter will return an error. 35 | 36 | 37 | Most Other Endpoints 38 | -------------------- 39 | 40 | ``tweet_mode`` 41 | ++++++++++++++ 42 | 43 | * Any endpoint that returns a tweet will accept this param. 44 | 45 | * Must be in ``['compat', 'extended']`` 46 | 47 | * If ``tweet_mode == 'compat'``, then no ``extended_tweet`` node in the json returned. 48 | 49 | * If ``tweet_mode == 'extended'``, then you'll get the ``extended_tweet`` node. 50 | 51 | 52 | Errors 53 | ------ 54 | * 44 -> URL passed to attachment_url is invalid 55 | 56 | * 385 -> Replied to deleted tweet or tweet not visible to you 57 | 58 | * 386 -> Too many attachments types (ie a GIF + quote tweet) 59 | 60 | 61 | Streaming API 62 | ============= 63 | 64 | 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. 65 | 66 | 67 | Changes to Models 68 | ================= 69 | 70 | Classic tweet: tweet with length < 140 char. 71 | Extended tweet: tweet with extended entities and text > 140 chars. 72 | 73 | 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. 74 | 75 | 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: 76 | 77 | * ``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.) 78 | 79 | * ``truncated`` -> gets set to ``True`` if extended tweet is rendered in compat mode. 80 | -------------------------------------------------------------------------------- /doc/contributing.rst: -------------------------------------------------------------------------------- 1 | Contributing 2 | ------------ 3 | 4 | Getting the code 5 | ================ 6 | 7 | The code is hosted at `Github `_. 8 | 9 | Check out the latest development version anonymously with:: 10 | 11 | $ git clone git://github.com/bear/python-twitter.git 12 | $ cd python-twitter 13 | 14 | The following sections assuming that you have `pyenv 15 | `_ installed and working on your computer. 16 | 17 | To install dependencies, run:: 18 | 19 | $ make dev 20 | 21 | This will install all of the required packages for the core library, testing, 22 | and installation. 23 | 24 | Testing 25 | ======= 26 | 27 | Once you have your development environment set up, you can run:: 28 | 29 | $ make test 30 | 31 | to ensure that all tests are currently passing before starting work. You can 32 | also check test coverage by running:: 33 | 34 | $ make coverage 35 | 36 | Pull requests are welcome or, if you are having trouble, please open an issue on 37 | GitHub. 38 | -------------------------------------------------------------------------------- /doc/getting_started.rst: -------------------------------------------------------------------------------- 1 | Getting Started 2 | =============== 3 | 4 | Getting your application tokens 5 | +++++++++++++++++++++++++++++++ 6 | 7 | .. danger:: 8 | 9 | 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. 10 | 11 | 12 | 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. 13 | 14 | Create your app 15 | ________________ 16 | 17 | 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. 18 | 19 | 20 | .. image:: python-twitter-app-creation-part1.png 21 | 22 | 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: 23 | 24 | Your app 25 | _________ 26 | 27 | Once your app is created, you'll be directed to a new page showing you some information about it. 28 | 29 | .. image:: python-twitter-app-creation-part2-new.png 30 | 31 | Your Keys 32 | _________ 33 | 34 | Click on the "Keys and Access Tokens" tab on the top. 35 | 36 | 37 | .. image:: python-twitter-app-creation-part3-new.png 38 | 39 | 40 | Under the "Access token & access token secret" option, click on the "create" button to generate a new access token and token secret. 41 | 42 | .. image:: python-twitter-app-creation-part3-1-new.png 43 | 44 | 45 | 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:: 46 | 47 | import twitter 48 | api = twitter.Api(consumer_key=, 49 | consumer_secret=, 50 | access_token_key=, 51 | access_token_secret=) 52 | 53 | 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. 54 | 55 | 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. 56 | 57 | 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. 58 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | .. python-twitter documentation master file, created by 2 | 3 | Welcome to python-twitter's documentation! 4 | ========================================== 5 | **A Python wrapper around the Twitter API.** 6 | 7 | Author: The Python-Twitter Developers 8 | 9 | 10 | Contents: 11 | 12 | .. toctree:: 13 | :maxdepth: 1 14 | 15 | installation.rst 16 | getting_started.rst 17 | contributing.rst 18 | migration_v30.rst 19 | changelog.rst 20 | rate_limits.rst 21 | models.rst 22 | searching.rst 23 | with_django.rst 24 | twitter.rst 25 | 26 | 27 | Introduction 28 | ------------ 29 | This library provides a pure Python interface for the `Twitter API `_. It works with Python 2.7+ and Python 3. 30 | 31 | `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. 32 | 33 | 34 | Indices and tables 35 | ================== 36 | 37 | * :ref:`genindex` 38 | * :ref:`modindex` 39 | * :ref:`search` 40 | -------------------------------------------------------------------------------- /doc/installation.rst: -------------------------------------------------------------------------------- 1 | Installation & Testing 2 | ------------ 3 | 4 | Installation 5 | ============ 6 | 7 | **From PyPI** :: 8 | 9 | $ pip install python-twitter 10 | 11 | 12 | **From source** 13 | 14 | Install the dependencies: 15 | 16 | - `Requests `_ 17 | - `Requests OAuthlib `_ 18 | 19 | Alternatively use `pip`:: 20 | 21 | $ pip install -r requirements.txt 22 | 23 | Download the latest `python-twitter` library from: https://github.com/bear/python-twitter/ 24 | 25 | Extract the source distribution and run:: 26 | 27 | $ python setup.py build 28 | $ python setup.py install 29 | 30 | 31 | Testing 32 | ======= 33 | 34 | The following requires ``pip install pytest`` and ``pip install pytest-cov``. Run:: 35 | 36 | $ make test 37 | 38 | If you would like to see coverage information:: 39 | 40 | $ make coverage 41 | 42 | 43 | Getting the code 44 | ================ 45 | 46 | The code is hosted at `Github `_. 47 | 48 | Check out the latest development version anonymously with:: 49 | 50 | $ git clone git://github.com/bear/python-twitter.git 51 | $ cd python-twitter 52 | -------------------------------------------------------------------------------- /doc/models.rst: -------------------------------------------------------------------------------- 1 | Models 2 | ====== 3 | 4 | Python-twitter provides the following models of the objects returned by the Twitter API: 5 | 6 | * :py:class:`twitter.models.Category` 7 | * :py:class:`twitter.models.DirectMessage` 8 | * :py:class:`twitter.models.Hashtag` 9 | * :py:class:`twitter.models.List` 10 | * :py:class:`twitter.models.Media` 11 | * :py:class:`twitter.models.Status` 12 | * :py:class:`twitter.models.Trend` 13 | * :py:class:`twitter.models.Url` 14 | * :py:class:`twitter.models.User` 15 | * :py:class:`twitter.models.UserStatus` 16 | -------------------------------------------------------------------------------- /doc/modules.rst: -------------------------------------------------------------------------------- 1 | .. _modules: 2 | 3 | Modules 4 | ******* 5 | 6 | .. toctree:: 7 | :maxdepth: 4 8 | 9 | twitter 10 | 11 | -------------------------------------------------------------------------------- /doc/python-twitter-app-creation-part1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/doc/python-twitter-app-creation-part1.png -------------------------------------------------------------------------------- /doc/python-twitter-app-creation-part2-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/doc/python-twitter-app-creation-part2-new.png -------------------------------------------------------------------------------- /doc/python-twitter-app-creation-part2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/doc/python-twitter-app-creation-part2.png -------------------------------------------------------------------------------- /doc/python-twitter-app-creation-part3-1-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/doc/python-twitter-app-creation-part3-1-new.png -------------------------------------------------------------------------------- /doc/python-twitter-app-creation-part3-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/doc/python-twitter-app-creation-part3-new.png -------------------------------------------------------------------------------- /doc/python-twitter-app-creation-part3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/doc/python-twitter-app-creation-part3.png -------------------------------------------------------------------------------- /doc/searching.rst: -------------------------------------------------------------------------------- 1 | .. _searching: 2 | 3 | Searching 4 | +++++++++ 5 | 6 | 7 | .. _raw_queries: 8 | 9 | Raw Queries 10 | =========== 11 | 12 | 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. 13 | 14 | For example, if you want to search for only tweets containing the word "twitter", then you could do the following: :: 15 | 16 | results = api.GetSearch( 17 | raw_query="q=twitter%20&result_type=recent&since=2014-07-19&count=100") 18 | 19 | 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. 20 | -------------------------------------------------------------------------------- /doc/twitter.rst: -------------------------------------------------------------------------------- 1 | Modules Documentation 2 | ===================== 3 | 4 | 5 | API 6 | ---------------- 7 | 8 | .. automodule:: twitter.api 9 | :members: 10 | :undoc-members: 11 | :show-inheritance: 12 | 13 | .. automodule:: twitter.error 14 | :members: 15 | :undoc-members: 16 | :show-inheritance: 17 | 18 | Models 19 | --------------------- 20 | 21 | .. automodule:: twitter.models 22 | :members: 23 | :undoc-members: 24 | :show-inheritance: 25 | 26 | .. automodule:: twitter.ratelimit 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | 32 | Utilities 33 | --------------------- 34 | 35 | .. automodule:: twitter.twitter_utils 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | -------------------------------------------------------------------------------- /doc/with_django.rst: -------------------------------------------------------------------------------- 1 | Using with Django 2 | ================= 3 | 4 | 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 -------------------------------------------------------------------------------- /examples/get_all_user_tweets.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | Downloads all tweets from a given user. 6 | 7 | Uses twitter.Api.GetUserTimeline to retreive the last 3,200 tweets from a user. 8 | Twitter doesn't allow retreiving more tweets than this through the API, so we get 9 | as many as possible. 10 | 11 | t.py should contain the imported variables. 12 | """ 13 | 14 | from __future__ import print_function 15 | 16 | import json 17 | import sys 18 | 19 | import twitter 20 | from t import ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET, CONSUMER_KEY, CONSUMER_SECRET 21 | 22 | 23 | def get_tweets(api=None, screen_name=None): 24 | timeline = api.GetUserTimeline(screen_name=screen_name, count=200) 25 | earliest_tweet = min(timeline, key=lambda x: x.id).id 26 | print("getting tweets before:", earliest_tweet) 27 | 28 | while True: 29 | tweets = api.GetUserTimeline( 30 | screen_name=screen_name, max_id=earliest_tweet, count=200 31 | ) 32 | new_earliest = min(tweets, key=lambda x: x.id).id 33 | 34 | if not tweets or new_earliest == earliest_tweet: 35 | break 36 | else: 37 | earliest_tweet = new_earliest 38 | print("getting tweets before:", earliest_tweet) 39 | timeline += tweets 40 | 41 | return timeline 42 | 43 | 44 | if __name__ == "__main__": 45 | api = twitter.Api( 46 | CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET 47 | ) 48 | screen_name = sys.argv[1] 49 | print(screen_name) 50 | timeline = get_tweets(api=api, screen_name=screen_name) 51 | 52 | with open('examples/timeline.json', 'w+') as f: 53 | for tweet in timeline: 54 | f.write(json.dumps(tweet._json)) 55 | f.write('\n') 56 | -------------------------------------------------------------------------------- /examples/streaming/track_users.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2007-2016 The Python-Twitter Developers 4 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # ---------------------------------------------------------------------- 18 | 19 | # This file demonstrates how to track mentions of a specific set of users in 20 | # english language and archive those mentions to a local file. The output 21 | # file will contain one JSON string per line per Tweet. 22 | 23 | # To use this example, replace the W/X/Y/Zs with your keys obtained from 24 | # Twitter, or uncomment the lines for getting an environment variable. If you 25 | # are using a virtualenv on Linux, you can set environment variables in the 26 | # ~/VIRTUALENVDIR/bin/activate script. 27 | 28 | # If you need assistance with obtaining keys from Twitter, see the instructions 29 | # in doc/getting_started.rst. 30 | 31 | import os 32 | import json 33 | 34 | from twitter import Api 35 | 36 | # Either specify a set of keys here or use os.getenv('CONSUMER_KEY') style 37 | # assignment: 38 | 39 | CONSUMER_KEY = 'WWWWWWWW' 40 | # CONSUMER_KEY = os.getenv("CONSUMER_KEY", None) 41 | CONSUMER_SECRET = 'XXXXXXXX' 42 | # CONSUMER_SECRET = os.getenv("CONSUMER_SECRET", None) 43 | ACCESS_TOKEN = 'YYYYYYYY' 44 | # ACCESS_TOKEN = os.getenv("ACCESS_TOKEN", None) 45 | ACCESS_TOKEN_SECRET = 'ZZZZZZZZ' 46 | # ACCESS_TOKEN_SECRET = os.getenv("ACCESS_TOKEN_SECRET", None) 47 | 48 | # Users to watch for should be a list. This will be joined by Twitter and the 49 | # data returned will be for any tweet mentioning: 50 | # @twitter *OR* @twitterapi *OR* @support. 51 | USERS = ['@twitter', 52 | '@twitterapi', 53 | '@support'] 54 | 55 | # Languages to filter tweets by is a list. This will be joined by Twitter 56 | # to return data mentioning tweets only in the english language. 57 | LANGUAGES = ['en'] 58 | 59 | # Since we're going to be using a streaming endpoint, there is no need to worry 60 | # about rate limits. 61 | api = Api(CONSUMER_KEY, 62 | CONSUMER_SECRET, 63 | ACCESS_TOKEN, 64 | ACCESS_TOKEN_SECRET) 65 | 66 | 67 | def main(): 68 | with open('output.txt', 'a') as f: 69 | # api.GetStreamFilter will return a generator that yields one status 70 | # message (i.e., Tweet) at a time as a JSON dictionary. 71 | for line in api.GetStreamFilter(track=USERS, languages=LANGUAGES): 72 | f.write(json.dumps(line)) 73 | f.write('\n') 74 | 75 | 76 | if __name__ == '__main__': 77 | main() 78 | -------------------------------------------------------------------------------- /examples/twitter-to-xhtml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2007-2016 The Python-Twitter Developers 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # ------------------------------------------------------------------------ 18 | # Load the latest update for a Twitter user and output it as an HTML fragment 19 | # 20 | 21 | from __future__ import print_function 22 | import codecs 23 | import sys 24 | import argparse 25 | 26 | import twitter 27 | 28 | from t import * 29 | 30 | __author__ = 'dewitt@google.com' 31 | 32 | TEMPLATE = """ 33 |
34 | Twitter: {user}
35 | {tweet_text}
36 | Posted {tweet_created} 37 |
38 | """ 39 | 40 | 41 | def main(**kwargs): 42 | api = twitter.Api(CONSUMER_KEY, 43 | CONSUMER_SECRET, 44 | ACCESS_KEY, 45 | ACCESS_SECRET) 46 | 47 | if kwargs['user_id'] is not None: 48 | statuses = api.GetUserTimeline(user_id=kwargs['user_id']) 49 | elif kwargs['screenname'] is not None: 50 | statuses = api.GetUserTimeline(screen_name=kwargs['screenname']) 51 | 52 | if kwargs['output_file'] is not None: 53 | with open(kwargs['output_file'], 'w+') as f: 54 | for status in statuses: 55 | f.write(status) 56 | else: 57 | for status in statuses: 58 | print(TEMPLATE.format(user=status.user.screen_name, 59 | tweet_text=status.text, 60 | status_id=status.id, 61 | tweet_created=status.created_at)) 62 | 63 | 64 | if __name__ == "__main__": 65 | parser = argparse.ArgumentParser() 66 | group = parser.add_mutually_exclusive_group() 67 | group.add_argument('--user-id', help='User id for which to return timeline') 68 | group.add_argument('--screenname', help='Screenname for which to return timeline') 69 | parser.add_argument('--output-file', help='Write to file instead of stdout') 70 | args = parser.parse_args() 71 | if not (args.user_id or args.screenname): 72 | raise ValueError("You must specify one of user-id or screenname") 73 | if not all([CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET]): 74 | raise ValueError("You must define CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET in t.py") 75 | main(user_id=args.user_id, screenname=args.screenname, output_file=args.output_file) 76 | -------------------------------------------------------------------------------- /examples/view_friends.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016 The Python-Twitter Developers 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # ------------------------------------------------------------------------ 18 | # Change History 19 | # 2010-10-01 20 | # Initial commit by @jsteiner207 21 | # 22 | # 2014-12-29 23 | # PEP8 update by @radzhome 24 | # 25 | # 2016-05-07 26 | # Update for Python3 by @jeremylow 27 | # 28 | 29 | from __future__ import print_function 30 | import twitter 31 | 32 | CONSUMER_KEY = 'WWWWWWWW' 33 | CONSUMER_SECRET = 'XXXXXXXX' 34 | ACCESS_TOKEN = 'YYYYYYYY' 35 | ACCESS_TOKEN_SECRET = 'ZZZZZZZZ' 36 | 37 | 38 | # Create an Api instance. 39 | api = twitter.Api(consumer_key=CONSUMER_KEY, 40 | consumer_secret=CONSUMER_SECRET, 41 | access_token_key=ACCESS_TOKEN, 42 | access_token_secret=ACCESS_TOKEN_SECRET) 43 | 44 | users = api.GetFriends() 45 | 46 | print([u.screen_name for u in users]) 47 | -------------------------------------------------------------------------------- /get_access_token.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2007-2018 The Python-Twitter Developers 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | """Utility to get your access tokens.""" 18 | 19 | from __future__ import print_function 20 | 21 | from requests_oauthlib import OAuth1Session 22 | import webbrowser 23 | 24 | import sys 25 | 26 | if sys.version_info.major < 3: 27 | input = raw_input 28 | 29 | REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token' 30 | ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token' 31 | AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize' 32 | SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate' 33 | 34 | 35 | def get_access_token(consumer_key, consumer_secret): 36 | """Get an access token for a given consumer key and secret. 37 | 38 | Args: 39 | consumer_key (str): 40 | Your application consumer key. 41 | consumer_secret (str): 42 | Your application consumer secret. 43 | 44 | Returns: 45 | (None) Prints to command line. 46 | """ 47 | oauth_client = OAuth1Session(consumer_key, client_secret=consumer_secret, callback_uri='oob') 48 | 49 | print('\nRequesting temp token from Twitter...\n') 50 | 51 | resp = oauth_client.fetch_request_token(REQUEST_TOKEN_URL) 52 | 53 | url = oauth_client.authorization_url(AUTHORIZATION_URL) 54 | 55 | print('I will try to start a browser to visit the following Twitter page ' 56 | 'if a browser will not start, copy the URL to your browser ' 57 | 'and retrieve the pincode to be used ' 58 | 'in the next step to obtaining an Authentication Token: \n' 59 | '\n\t{0}'.format(url)) 60 | 61 | webbrowser.open(url) 62 | pincode = input('\nEnter your pincode? ') 63 | 64 | print('\nGenerating and signing request for an access token...\n') 65 | 66 | oauth_client = OAuth1Session(consumer_key, client_secret=consumer_secret, 67 | resource_owner_key=resp.get('oauth_token'), 68 | resource_owner_secret=resp.get('oauth_token_secret'), 69 | verifier=pincode) 70 | try: 71 | resp = oauth_client.fetch_access_token(ACCESS_TOKEN_URL) 72 | except ValueError as e: 73 | raise 'Invalid response from Twitter requesting temp token: {0}'.format(e) 74 | 75 | print('''Your tokens/keys are as follows: 76 | consumer_key = {ck} 77 | consumer_secret = {cs} 78 | access_token_key = {atk} 79 | access_token_secret = {ats}'''.format( 80 | ck=consumer_key, 81 | cs=consumer_secret, 82 | atk=resp.get('oauth_token'), 83 | ats=resp.get('oauth_token_secret'))) 84 | 85 | 86 | def main(): 87 | """Run script to get access token and secret for given app.""" 88 | consumer_key = input('Enter your consumer key: ') 89 | consumer_secret = input('Enter your consumer secret: ') 90 | get_access_token(consumer_key, consumer_secret) 91 | 92 | 93 | if __name__ == "__main__": 94 | main() 95 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | norecursedirs= 3 | venv 4 | */python?.?/* 5 | */site-packages/* 6 | .tox/* 7 | 8 | with-coverage = true 9 | cover-package = twitter 10 | cover-html = true 11 | cover-html-dir = htmlcov 12 | cover-erase = true 13 | cover-inclusive = true 14 | cover-branches = true 15 | -------------------------------------------------------------------------------- /requirements.docs.txt: -------------------------------------------------------------------------------- 1 | requests 2 | requests-oauthlib 3 | sphinx 4 | sphinx_rtd_theme 5 | -------------------------------------------------------------------------------- /requirements.testing.txt: -------------------------------------------------------------------------------- 1 | requests 2 | requests-oauthlib 3 | responses 4 | 5 | pytest 6 | pytest-cov 7 | pytest-runner 8 | mccabe 9 | mock 10 | six 11 | coverage 12 | coveralls 13 | codecov 14 | check-manifest 15 | tox 16 | tox-pyenv 17 | pycodestyle 18 | 19 | hypothesis 20 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | requests-oauthlib 3 | filetype 4 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [aliases] 2 | test = pytest 3 | 4 | [bdist_wheel] 5 | universal=1 6 | 7 | [check-manifest] 8 | ignore = 9 | .travis.yml 10 | circle.yml 11 | violations.flake8.txt 12 | 13 | [flake8] 14 | ignore = E111,E124,E126,E221,E501 15 | 16 | [pycodestyle] 17 | ignore = E111,E124,E126,E221,E501 18 | max-line-length = 100 19 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from __future__ import absolute_import, print_function 4 | 5 | # 6 | # Copyright 2007-2016 The Python-Twitter Developers 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | 20 | import os 21 | import re 22 | import codecs 23 | 24 | from setuptools import setup, find_packages 25 | 26 | 27 | cwd = os.path.abspath(os.path.dirname(__file__)) 28 | 29 | def read(filename): 30 | with codecs.open(os.path.join(cwd, filename), 'rb', 'utf-8') as h: 31 | return h.read() 32 | 33 | def convert_txt(txt): 34 | lst_txt = txt.split('\n') 35 | for i in range(len(lst_txt)): 36 | line = lst_txt[i] 37 | match = re.match(r' +(\S.+)', line) 38 | if match is not None: 39 | lst_txt[i] = '\n| {}'.format(match.group(1)) 40 | else: 41 | match_date = re.match(r'(\d+-\d+-\d+)', line) 42 | if match_date is not None: 43 | lst_txt[i] = '\n**{}**'.format(match_date.group(1)) 44 | return '\n'.join(lst_txt) 45 | 46 | metadata = read(os.path.join(cwd, 'twitter', '__init__.py')) 47 | 48 | def extract_metaitem(meta): 49 | # swiped from https://hynek.me 's attr package 50 | meta_match = re.search(r"""^__{meta}__\s+=\s+['\"]([^'\"]*)['\"]""".format(meta=meta), 51 | metadata, re.MULTILINE) 52 | if meta_match: 53 | return meta_match.group(1) 54 | raise RuntimeError('Unable to find __{meta}__ string.'.format(meta=meta)) 55 | 56 | setup( 57 | name='python-twitter', 58 | version=extract_metaitem('version'), 59 | license=extract_metaitem('license'), 60 | description=extract_metaitem('description'), 61 | long_description=(read('README.rst') + '\n\n' + 62 | read('AUTHORS.rst') + '\n\n' + 63 | convert_txt(read('CHANGES'))), 64 | long_description_content_type = 'text/x-rst', 65 | author=extract_metaitem('author'), 66 | author_email=extract_metaitem('email'), 67 | maintainer=extract_metaitem('author'), 68 | maintainer_email=extract_metaitem('email'), 69 | url=extract_metaitem('url'), 70 | download_url=extract_metaitem('download_url'), 71 | packages=find_packages(exclude=('tests', 'docs')), 72 | platforms=['Any'], 73 | install_requires=['requests', 'requests-oauthlib', 'filetype'], 74 | tests_require=['pytest'], 75 | keywords='twitter api', 76 | classifiers=[ 77 | 'Development Status :: 5 - Production/Stable', 78 | 'Intended Audience :: Developers', 79 | 'License :: OSI Approved :: Apache Software License', 80 | 'Operating System :: OS Independent', 81 | 'Topic :: Software Development :: Libraries :: Python Modules', 82 | 'Topic :: Communications :: Chat', 83 | 'Topic :: Internet', 84 | 'Programming Language :: Python', 85 | 'Programming Language :: Python :: 2', 86 | 'Programming Language :: Python :: 2.7', 87 | 'Programming Language :: Python :: 3', 88 | 'Programming Language :: Python :: 3.6', 89 | ], 90 | ) 91 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | if __name__ == '__main__': 4 | testsuite = unittest.TestLoader().discover('.') 5 | unittest.TextTestRunner(verbosity=1).run(testsuite) 6 | -------------------------------------------------------------------------------- /testdata/168NQ.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/testdata/168NQ.jpg -------------------------------------------------------------------------------- /testdata/3.2/extended_tweet_in_compat_mode.json: -------------------------------------------------------------------------------- 1 | {"contributors": null, "in_reply_to_status_id_str": null, "lang": "en", "source": "Twitter Web Client", "in_reply_to_user_id": null, "possibly_sensitive_appealable": false, "coordinates": null, "truncated": true, "retweet_count": 0, "retweeted": false, "possibly_sensitive": false, "in_reply_to_user_id_str": null, "entities": {"symbols": [], "user_mentions": [], "urls": [{"expanded_url": "https://twitter.com/i/web/status/782737772490600448", "indices": [117, 140], "url": "https://t.co/et3OTOxWSa", "display_url": "twitter.com/i/web/status/7\u2026"}], "hashtags": []}, "geo": null, "is_quote_status": false, "favorite_count": 0, "id_str": "782737772490600448", "id": 782737772490600448, "created_at": "Mon Oct 03 00:23:22 +0000 2016", "text": "has more details about these changes. Thanks for making more expressive!writing requirements to python_twitt pytho\u2026 https://t.co/et3OTOxWSa", "place": null, "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "favorited": false, "user": {"follow_request_sent": false, "protected": true, "default_profile_image": true, "profile_sidebar_fill_color": "000000", "favourites_count": 1, "utc_offset": null, "has_extended_profile": false, "lang": "en", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "friends_count": 2, "profile_text_color": "000000", "geo_enabled": true, "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "verified": false, "listed_count": 1, "is_translator": false, "location": "", "entities": {"description": {"urls": []}}, "name": "notinourselves", "is_translation_enabled": false, "time_zone": null, "id_str": "4012966701", "profile_background_tile": false, "followers_count": 1, "profile_sidebar_border_color": "000000", "contributors_enabled": false, "following": false, "description": "", "url": null, "statuses_count": 84, "default_profile": false, "profile_link_color": "000000", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "notifications": false, "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg", "screen_name": "notinourselves", "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg", "id": 4012966701, "profile_use_background_image": true, "created_at": "Wed Oct 21 23:53:04 +0000 2015", "profile_background_color": "000000"}} -------------------------------------------------------------------------------- /testdata/3.2/extended_tweet_in_extended_mode.json: -------------------------------------------------------------------------------- 1 | {"contributors": null, "in_reply_to_status_id_str": null, "lang": "en", "in_reply_to_user_id_str": null, "in_reply_to_user_id": null, "possibly_sensitive_appealable": false, "coordinates": null, "full_text": "has more details about these changes. Thanks for making more expressive!writing requirements to python_twitt python_twitter.egg-info/SOURCE https://t.co/JWSPztfoyt", "truncated": false, "retweet_count": 0, "retweeted": false, "possibly_sensitive": false, "entities": {"symbols": [], "media": [{"id_str": "782737766455119872", "type": "photo", "media_url_https": "https://pbs.twimg.com/media/CtzX2fnXEAAMAjK.jpg", "display_url": "pic.twitter.com/JWSPztfoyt", "sizes": {"large": {"w": 1024, "resize": "fit", "h": 1024}, "thumb": {"w": 150, "resize": "crop", "h": 150}, "small": {"w": 680, "resize": "fit", "h": 680}, "medium": {"w": 1024, "resize": "fit", "h": 1024}}, "expanded_url": "https://twitter.com/notinourselves/status/782737772490600448/photo/1", "indices": [141, 164], "id": 782737766455119872, "url": "https://t.co/JWSPztfoyt", "media_url": "http://pbs.twimg.com/media/CtzX2fnXEAAMAjK.jpg"}], "user_mentions": [], "urls": [], "hashtags": []}, "geo": null, "is_quote_status": false, "favorite_count": 0, "id_str": "782737772490600448", "extended_entities": {"media": [{"id_str": "782737766455119872", "type": "photo", "media_url_https": "https://pbs.twimg.com/media/CtzX2fnXEAAMAjK.jpg", "display_url": "pic.twitter.com/JWSPztfoyt", "sizes": {"large": {"w": 1024, "resize": "fit", "h": 1024}, "thumb": {"w": 150, "resize": "crop", "h": 150}, "small": {"w": 680, "resize": "fit", "h": 680}, "medium": {"w": 1024, "resize": "fit", "h": 1024}}, "expanded_url": "https://twitter.com/notinourselves/status/782737772490600448/photo/1", "indices": [141, 164], "id": 782737766455119872, "url": "https://t.co/JWSPztfoyt", "media_url": "http://pbs.twimg.com/media/CtzX2fnXEAAMAjK.jpg", "ext_alt_text": null}]}, "created_at": "Mon Oct 03 00:23:22 +0000 2016", "source": "Twitter Web Client", "place": null, "favorited": false, "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "id": 782737772490600448, "display_text_range": [0, 140], "user": {"follow_request_sent": false, "protected": true, "default_profile_image": true, "profile_sidebar_fill_color": "000000", "favourites_count": 1, "utc_offset": null, "has_extended_profile": false, "lang": "en", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "friends_count": 2, "profile_text_color": "000000", "geo_enabled": true, "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "verified": false, "listed_count": 1, "is_translator": false, "location": "", "entities": {"description": {"urls": []}}, "name": "notinourselves", "is_translation_enabled": false, "time_zone": null, "id_str": "4012966701", "profile_background_tile": false, "followers_count": 1, "profile_sidebar_border_color": "000000", "contributors_enabled": false, "following": false, "description": "", "url": null, "statuses_count": 84, "default_profile": false, "profile_link_color": "000000", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "notifications": false, "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg", "screen_name": "notinourselves", "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg", "id": 4012966701, "profile_use_background_image": true, "created_at": "Wed Oct 21 23:53:04 +0000 2015", "profile_background_color": "000000"}} -------------------------------------------------------------------------------- /testdata/corgi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/testdata/corgi.gif -------------------------------------------------------------------------------- /testdata/create_friendship.json: -------------------------------------------------------------------------------- 1 | {"id":2425151,"id_str":"2425151","name":"Facebook","screen_name":"facebook","location":"Menlo Park, California","description":"Give people the power to build community and bring the world closer together.","url":"http:\/\/t.co\/7bZ2KCQJ2k","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/7bZ2KCQJ2k","expanded_url":"http:\/\/facebook.com","display_url":"facebook.com","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":14034525,"friends_count":92,"listed_count":43686,"created_at":"Tue Mar 27 07:29:25 +0000 2007","favourites_count":430,"utc_offset":-28800,"time_zone":"Pacific Time (US & Canada)","geo_enabled":false,"verified":true,"statuses_count":8481,"lang":"en","status":{"created_at":"Fri Dec 15 22:36:04 +0000 2017","id":941799043407269888,"id_str":"941799043407269888","text":"@adambungle Hi Adam. If there's already a Facebook account associated with your email address, please fill out this\u2026 https:\/\/t.co\/KJEGff3Sp8","truncated":true,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"adambungle","name":"Adam Forster","id":212532742,"id_str":"212532742","indices":[0,11]}],"urls":[{"url":"https:\/\/t.co\/KJEGff3Sp8","expanded_url":"https:\/\/twitter.com\/i\/web\/status\/941799043407269888","display_url":"twitter.com\/i\/web\/status\/9\u2026","indices":[117,140]}]},"source":"\u003ca href=\"http:\/\/www.spredfast.com\" rel=\"nofollow\"\u003eSpredfast app\u003c\/a\u003e","in_reply_to_status_id":941231370600435712,"in_reply_to_status_id_str":"941231370600435712","in_reply_to_user_id":212532742,"in_reply_to_user_id_str":"212532742","in_reply_to_screen_name":"adambungle","geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":1,"favorite_count":4,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"3C5A99","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/4699594\/quail_air_background.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/4699594\/quail_air_background.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/3513354941\/24aaffa670e634a7da9a087bfa83abe6_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/3513354941\/24aaffa670e634a7da9a087bfa83abe6_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2425151\/1506715336","profile_link_color":"3C5A99","profile_sidebar_border_color":"DEDEDE","profile_sidebar_fill_color":"FFFFFF","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false,"muting":false,"translator_type":"regular"} -------------------------------------------------------------------------------- /testdata/destroy_friendship.json: -------------------------------------------------------------------------------- 1 | {"id":2425151,"id_str":"2425151","name":"Facebook","screen_name":"facebook","location":"Menlo Park, California","description":"Give people the power to build community and bring the world closer together.","url":"http:\/\/t.co\/7bZ2KCQJ2k","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/7bZ2KCQJ2k","expanded_url":"http:\/\/facebook.com","display_url":"facebook.com","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":14034332,"friends_count":92,"listed_count":43686,"created_at":"Tue Mar 27 07:29:25 +0000 2007","favourites_count":430,"utc_offset":-28800,"time_zone":"Pacific Time (US & Canada)","geo_enabled":false,"verified":true,"statuses_count":8481,"lang":"en","status":{"created_at":"Fri Dec 15 22:36:04 +0000 2017","id":941799043407269888,"id_str":"941799043407269888","text":"@adambungle Hi Adam. If there's already a Facebook account associated with your email address, please fill out this\u2026 https:\/\/t.co\/KJEGff3Sp8","truncated":true,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"adambungle","name":"Adam Forster","id":212532742,"id_str":"212532742","indices":[0,11]}],"urls":[{"url":"https:\/\/t.co\/KJEGff3Sp8","expanded_url":"https:\/\/twitter.com\/i\/web\/status\/941799043407269888","display_url":"twitter.com\/i\/web\/status\/9\u2026","indices":[117,140]}]},"source":"\u003ca href=\"http:\/\/www.spredfast.com\" rel=\"nofollow\"\u003eSpredfast app\u003c\/a\u003e","in_reply_to_status_id":941231370600435712,"in_reply_to_status_id_str":"941231370600435712","in_reply_to_user_id":212532742,"in_reply_to_user_id_str":"212532742","in_reply_to_screen_name":"adambungle","geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":1,"favorite_count":4,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"3C5A99","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/4699594\/quail_air_background.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/4699594\/quail_air_background.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/3513354941\/24aaffa670e634a7da9a087bfa83abe6_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/3513354941\/24aaffa670e634a7da9a087bfa83abe6_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2425151\/1506715336","profile_link_color":"3C5A99","profile_sidebar_border_color":"DEDEDE","profile_sidebar_fill_color":"FFFFFF","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":true,"follow_request_sent":false,"notifications":false,"muting":false,"translator_type":"regular"} -------------------------------------------------------------------------------- /testdata/direct_message-destroy.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Tue Jun 05 06:00:51 +0000 2007", 3 | "recipient_id": 718443, 4 | "sender_id": 673483, 5 | "sender_screen_name": "dewitt", 6 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 7 | "recipient_screen_name": "kesuke", 8 | "id": 3496342 9 | } 10 | -------------------------------------------------------------------------------- /testdata/direct_messages-new.json: -------------------------------------------------------------------------------- 1 | { 2 | "sender_screen_name": "dewitt", 3 | "created_at": "Tue Jun 05 05:53:22 +0000 2007", 4 | "recipient_screen_name": "kesuke", 5 | "recipient_id": 718443, 6 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 7 | "id": 3496202, 8 | "sender_id": 673483 9 | } 10 | -------------------------------------------------------------------------------- /testdata/direct_messages.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "created_at": "Mon Jun 04 00:07:58 +0000 2007", 4 | "recipient_id": 718443, 5 | "sender_id": 673483, 6 | "text": "A l\u00e9gp\u00e1rn\u00e1s haj\u00f3m tele van angoln\u00e1kkal.", 7 | "sender_screen_name": "dewitt", 8 | "id": 3444662, 9 | "recipient_screen_name": "kesuke" 10 | } 11 | ] -------------------------------------------------------------------------------- /testdata/direct_messages/get_direct_messages_show.json: -------------------------------------------------------------------------------- 1 | {"sender_screen_name": "__jcbl__", "created_at": "Sun Dec 20 15:41:09 +0000 2015", "entities": {"symbols": [], "hashtags": [], "user_mentions": [], "urls": []}, "id": 678601038023147523, "text": "That's cool friend", "sender_id": 372018022, "id_str": "678601038023147523", "recipient_id_str": "4012966701", "recipient_screen_name": "notinourselves", "sender_id_str": "372018022", "recipient": {"protected": true, "geo_enabled": true, "listed_count": 1, "created_at": "Wed Oct 21 23:53:04 +0000 2015", "entities": {"description": {"urls": []}}, "url": null, "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "profile_background_tile": false, "follow_request_sent": false, "notifications": false, "statuses_count": 76, "profile_sidebar_fill_color": "000000", "has_extended_profile": false, "friends_count": 1, "following": false, "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "screen_name": "notinourselves", "lang": "en", "favourites_count": 1, "verified": false, "time_zone": null, "default_profile_image": true, "name": "notinourselves", "profile_sidebar_border_color": "000000", "id": 4012966701, "is_translation_enabled": false, "followers_count": 1, "profile_link_color": "000000", "profile_text_color": "000000", "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg", "utc_offset": null, "id_str": "4012966701", "default_profile": false, "contributors_enabled": false, "profile_use_background_image": true, "description": "", "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg", "profile_background_color": "000000", "location": "", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translator": false}, "recipient_id": 4012966701, "sender": {"protected": false, "geo_enabled": false, "listed_count": 6, "created_at": "Sun Sep 11 23:49:28 +0000 2011", "entities": {"description": {"urls": []}, "url": {"urls": [{"indices": [0, 22], "expanded_url": "http://iseverythingstilltheworst.com", "display_url": "iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX"}]}}, "url": "http://t.co/wtg3XzqQTX", "profile_image_url_https": "https://pbs.twimg.com/profile_images/719724025384083456/N98iQXqX_normal.jpg", "profile_background_tile": false, "follow_request_sent": false, "notifications": false, "statuses_count": 441, "profile_sidebar_fill_color": "000000", "has_extended_profile": false, "friends_count": 363, "following": true, "default_profile": false, "screen_name": "__jcbl__", "lang": "en", "favourites_count": 2212, "verified": false, "time_zone": "Eastern Time (US & Canada)", "default_profile_image": false, "name": "jeremy", "profile_sidebar_border_color": "000000", "id": 372018022, "is_translation_enabled": false, "followers_count": 67, "profile_link_color": "EE3355", "profile_text_color": "000000", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "utc_offset": -14400, "id_str": "372018022", "contributors_enabled": false, "profile_use_background_image": false, "description": "my kingdom for a microwave that doesn't beep", "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_color": "FFFFFF", "location": "not a very good kingdom tbh", "profile_image_url": "http://pbs.twimg.com/profile_images/719724025384083456/N98iQXqX_normal.jpg", "is_translator": false}} -------------------------------------------------------------------------------- /testdata/direct_messages/post_post_direct_message.json: -------------------------------------------------------------------------------- 1 | {"event": {"type": "message_create", "id": "1046388258840748037", "created_timestamp": "1538313376518", "message_create": {"target": {"recipient_id": "372018022"}, "sender_id": "372018022", "message_data": {"text": "hello", "entities": {"hashtags": [], "symbols": [], "user_mentions": [], "urls": []}}}}} -------------------------------------------------------------------------------- /testdata/friendship-create.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DeWitt", 3 | "description": "Indeterminate things", 4 | "location": "San Francisco, CA", 5 | "url": "http://unto.net/", 6 | "id": 673483, 7 | "protected": false, 8 | "status": { 9 | "created_at": "Sun Jun 03 19:50:23 +0000 2007", 10 | "text": "If a theme song played when I walked around all day, I'd want it to be All My Friends by LCD Soundsystem.", 11 | "id": 89586072 12 | }, 13 | "profile_image_url": "http://assets0.twitter.com/system/user/profile_image/673483/normal/me.jpg?1171965914", 14 | "screen_name": "dewitt" 15 | } 16 | -------------------------------------------------------------------------------- /testdata/friendship-destroy.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DeWitt", 3 | "description": "Indeterminate things", 4 | "location": "San Francisco, CA", 5 | "url": "http://unto.net/", 6 | "id": 673483, 7 | "protected": false, 8 | "status": { 9 | "created_at": "Sun Jun 03 19:50:23 +0000 2007", 10 | "text": "If a theme song played when I walked around all day, I'd want it to be All My Friends by LCD Soundsystem.", 11 | "id": 89586072 12 | }, 13 | "profile_image_url": "http://assets0.twitter.com/system/user/profile_image/673483/normal/me.jpg?1171965914", 14 | "screen_name": "dewitt" 15 | } 16 | -------------------------------------------------------------------------------- /testdata/get_blocks_0.json: -------------------------------------------------------------------------------- 1 | {"users":[{"id":68956490,"id_str":"68956490","name":"Robot J. McCarthy","screen_name":"RedScareBot","location":"Wisconsin","description":"Joseph McCarthy claimed there were large numbers of Communists and Soviet spies and sympathizers inside the United States federal government and elsewhere.","url":"http:\/\/t.co\/PiQZ8cvNsS","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/PiQZ8cvNsS","expanded_url":"http:\/\/bit.ly\/RdUCUi","display_url":"bit.ly\/RdUCUi","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":15257,"friends_count":134,"listed_count":1321,"created_at":"Wed Aug 26 11:37:30 +0000 2009","favourites_count":3018,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":2497529,"lang":"en","status":{"created_at":"Sat Nov 14 07:48:12 +0000 2015","id":665436049645166592,"id_str":"665436049645166592","text":"Socialism lite RT @culbgren Don't Claim bto Love the U.S.A. While Trying To Make It A Socialist Nation! https:\/\/t.co\/t8b9AesC1d","source":"\u003ca href=\"http:\/\/twitter.com\/RedScareBot\" rel=\"nofollow\"\u003eRedScareBot\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":665434140997771264,"in_reply_to_status_id_str":"665434140997771264","in_reply_to_user_id":2891911385,"in_reply_to_user_id_str":"2891911385","in_reply_to_screen_name":"culbgren","geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":25,"favorite_count":39,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"culbgren","name":"Donna\u2734","id":2891911385,"id_str":"2891911385","indices":[18,27]}],"urls":[],"media":[{"id":665434138170773504,"id_str":"665434138170773504","indices":[104,127],"media_url":"http:\/\/pbs.twimg.com\/media\/CTwY0rMWUAAJWB1.jpg","media_url_https":"https:\/\/pbs.twimg.com\/media\/CTwY0rMWUAAJWB1.jpg","url":"https:\/\/t.co\/t8b9AesC1d","display_url":"pic.twitter.com\/t8b9AesC1d","expanded_url":"http:\/\/twitter.com\/culbgren\/status\/665434140997771264\/photo\/1","type":"photo","sizes":{"small":{"w":340,"h":263,"resize":"fit"},"medium":{"w":557,"h":432,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"},"large":{"w":557,"h":432,"resize":"fit"}},"source_status_id":665434140997771264,"source_status_id_str":"665434140997771264","source_user_id":2891911385,"source_user_id_str":"2891911385"}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/32132396\/emo.jpg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/32132396\/emo.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/382754962\/mccarthy_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/382754962\/mccarthy_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/68956490\/1397719213","profile_link_color":"7C009E","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"A199A3","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false,"muting":false,"blocking":true,"blocked_by":false}],"next_cursor":1524574483549312671,"next_cursor_str":"1524574483549312671","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_blocks_1.json: -------------------------------------------------------------------------------- 1 | {"users":[{"id":68956490,"id_str":"68956490","name":"Robot J. McCarthy","screen_name":"RedScareBot","location":"Wisconsin","description":"Joseph McCarthy claimed there were large numbers of Communists and Soviet spies and sympathizers inside the United States federal government and elsewhere.","url":"http:\/\/t.co\/PiQZ8cvNsS","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/PiQZ8cvNsS","expanded_url":"http:\/\/bit.ly\/RdUCUi","display_url":"bit.ly\/RdUCUi","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":15257,"friends_count":134,"listed_count":1321,"created_at":"Wed Aug 26 11:37:30 +0000 2009","favourites_count":3018,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":2497529,"lang":"en","status":{"created_at":"Sat Nov 14 07:48:12 +0000 2015","id":665436049645166592,"id_str":"665436049645166592","text":"Socialism lite RT @culbgren Don't Claim bto Love the U.S.A. While Trying To Make It A Socialist Nation! https:\/\/t.co\/t8b9AesC1d","source":"\u003ca href=\"http:\/\/twitter.com\/RedScareBot\" rel=\"nofollow\"\u003eRedScareBot\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":665434140997771264,"in_reply_to_status_id_str":"665434140997771264","in_reply_to_user_id":2891911385,"in_reply_to_user_id_str":"2891911385","in_reply_to_screen_name":"culbgren","geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":25,"favorite_count":39,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"culbgren","name":"Donna\u2734","id":2891911385,"id_str":"2891911385","indices":[18,27]}],"urls":[],"media":[{"id":665434138170773504,"id_str":"665434138170773504","indices":[104,127],"media_url":"http:\/\/pbs.twimg.com\/media\/CTwY0rMWUAAJWB1.jpg","media_url_https":"https:\/\/pbs.twimg.com\/media\/CTwY0rMWUAAJWB1.jpg","url":"https:\/\/t.co\/t8b9AesC1d","display_url":"pic.twitter.com\/t8b9AesC1d","expanded_url":"http:\/\/twitter.com\/culbgren\/status\/665434140997771264\/photo\/1","type":"photo","sizes":{"small":{"w":340,"h":263,"resize":"fit"},"medium":{"w":557,"h":432,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"},"large":{"w":557,"h":432,"resize":"fit"}},"source_status_id":665434140997771264,"source_status_id_str":"665434140997771264","source_user_id":2891911385,"source_user_id_str":"2891911385"}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/32132396\/emo.jpg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/32132396\/emo.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/382754962\/mccarthy_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/382754962\/mccarthy_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/68956490\/1397719213","profile_link_color":"7C009E","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"A199A3","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false,"muting":false,"blocking":true,"blocked_by":false}],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_blocks_ids_0.json: -------------------------------------------------------------------------------- 1 | {"next_cursor": 1524566179872860311, "next_cursor_str": "1524566179872860311", "previous_cursor": 0, "ids": [68956490], "previous_cursor_str": "0"} -------------------------------------------------------------------------------- /testdata/get_blocks_ids_1.json: -------------------------------------------------------------------------------- 1 | {"next_cursor": 0, "next_cursor_str": "0", "previous_cursor": 0, "ids": [68956490], "previous_cursor_str": "0"} -------------------------------------------------------------------------------- /testdata/get_favorites.json: -------------------------------------------------------------------------------- 1 | [{"created_at":"Wed Dec 16 17:34:59 +0000 2015","id":677180133447372800,"id_str":"677180133447372800","text":"Extremely proud of all the bot-makers this year. Seeing so many diff bots get love & recognition is getting me a little teared-up, tbh. \ud83d\ude0c\ud83d\udc4d","source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":619383,"id_str":"619383","name":"Humbug me why I","screen_name":"negatendo","location":"Denver CO USA Earth Cyberspace","description":"artist (strictly internet). ridiculous internet account. full-time internet. free ideas internet. #botALLY https:\/\/t.co\/P0PVMrvqUn","url":"https:\/\/t.co\/6bPCtM8sau","entities":{"url":{"urls":[{"url":"https:\/\/t.co\/6bPCtM8sau","expanded_url":"http:\/\/negatendo.net\/","display_url":"negatendo.net","indices":[0,23]}]},"description":{"urls":[{"url":"https:\/\/t.co\/P0PVMrvqUn","expanded_url":"http:\/\/www.amazon.com\/registry\/wishlist\/5NKIOO98X4J5\/","display_url":"amazon.com\/registry\/wishl\u2026","indices":[107,130]}]}},"protected":false,"followers_count":2416,"friends_count":2080,"listed_count":104,"created_at":"Tue Jan 09 19:26:46 +0000 2007","favourites_count":63457,"utc_offset":-25200,"time_zone":"Mountain Time (US & Canada)","geo_enabled":true,"verified":false,"statuses_count":35938,"lang":"en-gb","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"FFFFFF","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/378800000105212902\/2a4019c9c7bca6253bd2564f74483c35.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/378800000105212902\/2a4019c9c7bca6253bd2564f74483c35.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/660834065419907072\/rV085r8i_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/660834065419907072\/rV085r8i_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/619383\/1398338002","profile_link_color":"D955E0","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"FFFFFF","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":1,"favorite_count":24,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":true,"retweeted":false,"lang":"en"}] -------------------------------------------------------------------------------- /testdata/get_follower_ids.json: -------------------------------------------------------------------------------- 1 | {"ids":[372018022],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_follower_ids_paged.json: -------------------------------------------------------------------------------- 1 | {"ids":[372018022],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_friends.json: -------------------------------------------------------------------------------- 1 | {"users":[{"id":372018022,"id_str":"372018022","name":"jeremy","screen_name":"__jcbl__","location":"not a very good kingdom tbh","description":"my kingdom for a microwave that doesn't beep","url":"http:\/\/t.co\/wtg3XzqQTX","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/wtg3XzqQTX","expanded_url":"http:\/\/iseverythingstilltheworst.com","display_url":"iseverythingstilltheworst.com","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":50,"friends_count":286,"listed_count":5,"created_at":"Sun Sep 11 23:49:28 +0000 2011","favourites_count":1220,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":311,"lang":"en","status":{"created_at":"Wed Dec 09 20:51:52 +0000 2015","id":674692964782891009,"id_str":"674692964782891009","text":"@beep @jonikorpi i made a bot to do the conversion for me, its @TheGIFingBot if you're interested. converts, uploads to imgur, dms you link.","source":"\u003ca href=\"http:\/\/klinkerapps.com\" rel=\"nofollow\"\u003eTalon (Plus)\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":674641293314809858,"in_reply_to_status_id_str":"674641293314809858","in_reply_to_user_id":12534,"in_reply_to_user_id_str":"12534","in_reply_to_screen_name":"beep","geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":1,"entities":{"hashtags":[],"symbols":[],"user_mentions":[{"screen_name":"beep","name":"Ethan Marcotte","id":12534,"id_str":"12534","indices":[0,5]},{"screen_name":"jonikorpi","name":"Joni Korpi","id":15907249,"id_str":"15907249","indices":[6,16]},{"screen_name":"TheGIFingBot","name":"The GIFing Bot","id":3206731269,"id_str":"3206731269","indices":[63,76]}],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"FFFFFF","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/659691753826615298\/yN1SoWrU_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/659691753826615298\/yN1SoWrU_normal.jpg","profile_link_color":"EE3355","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":true,"follow_request_sent":false,"notifications":false,"muting":false,"blocking":false,"blocked_by":false}],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_friends_ids.json: -------------------------------------------------------------------------------- 1 | {"ids":[372018022],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_friendships_lookup_muting.json: -------------------------------------------------------------------------------- 1 | [{"name": "dick costolo", "id": 6385432, "screen_name": "dickc", "id_str": "6385432", "connections": ["muting"]}] -------------------------------------------------------------------------------- /testdata/get_friendships_lookup_muting_blocking.json: -------------------------------------------------------------------------------- 1 | [{"name": "dick costolo", "id": 6385432, "screen_name": "dickc", "id_str": "6385432", "connections": ["blocking", "muting"]}] -------------------------------------------------------------------------------- /testdata/get_friendships_lookup_none.json: -------------------------------------------------------------------------------- 1 | [{"id_str": "12", "name": "Jack", "connections": ["none"], "screen_name": "jack", "id": 12}] -------------------------------------------------------------------------------- /testdata/get_get_memberships.json: -------------------------------------------------------------------------------- 1 | {"lists": [{"description": "", "subscriber_count": 0, "slug": "my-bots", "name": "my-bots", "member_count": 3, "mode": "public", "user": {"notifications": false, "profile_use_background_image": false, "has_extended_profile": false, "listed_count": 5, "profile_image_url": "http://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "verified": false, "lang": "en", "protected": false, "url": "http://t.co/wtg3XzqQTX", "statuses_count": 325, "profile_text_color": "000000", "profile_background_tile": false, "follow_request_sent": false, "id": 372018022, "default_profile_image": false, "contributors_enabled": false, "following": true, "profile_link_color": "EE3355", "followers_count": 49, "friends_count": 306, "location": "not a very good kingdom tbh", "description": "my kingdom for a microwave that doesn't beep", "profile_sidebar_fill_color": "000000", "default_profile": false, "utc_offset": -18000, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "favourites_count": 1279, "profile_background_color": "FFFFFF", "is_translation_enabled": false, "profile_sidebar_border_color": "000000", "profile_image_url_https": "https://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "geo_enabled": false, "time_zone": "Eastern Time (US & Canada)", "name": "jeremy", "id_str": "372018022", "entities": {"description": {"urls": []}, "url": {"urls": [{"display_url": "iseverythingstilltheworst.com", "indices": [0, 22], "expanded_url": "http://iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX"}]}}, "is_translator": false, "screen_name": "__jcbl__", "created_at": "Sun Sep 11 23:49:28 +0000 2011"}, "id_str": "225486809", "id": 225486809, "following": false, "full_name": "@__jcbl__/my-bots", "created_at": "Tue Nov 10 16:43:07 +0000 2015", "uri": "/__jcbl__/lists/my-bots"}], "next_cursor": 0, "previous_cursor_str": "0", "next_cursor_str": "0", "previous_cursor": 0} -------------------------------------------------------------------------------- /testdata/get_get_subscriptions.json: -------------------------------------------------------------------------------- 1 | {"lists": [{"description": "\u2728\ud83c\udf0c\u2728", "subscriber_count": 2, "slug": "space-bots", "name": "space bots", "member_count": 10, "mode": "public", "user": {"notifications": false, "profile_use_background_image": false, "has_extended_profile": false, "listed_count": 105, "profile_image_url": "http://pbs.twimg.com/profile_images/693009922846515200/dzwB3rPe_normal.jpg", "profile_background_image_url": "http://pbs.twimg.com/profile_background_images/628878668/zwcd99eo8b13p4wpbv2a.png", "verified": false, "lang": "en-gb", "protected": false, "url": "https://t.co/Wz4bls6kQh", "statuses_count": 26462, "profile_text_color": "333333", "profile_background_tile": false, "follow_request_sent": false, "id": 13148, "default_profile_image": false, "contributors_enabled": false, "following": false, "profile_link_color": "848484", "followers_count": 1618, "friends_count": 794, "location": "Dublin, Ireland", "profile_banner_url": "https://pbs.twimg.com/profile_banners/13148/1447542687", "description": "ambient music, art bots // @poem_exe", "profile_sidebar_fill_color": "C0DFEC", "default_profile": false, "utc_offset": 0, "profile_background_image_url_https": "https://pbs.twimg.com/profile_background_images/628878668/zwcd99eo8b13p4wpbv2a.png", "favourites_count": 64659, "profile_background_color": "EDEDF4", "is_translation_enabled": false, "profile_sidebar_border_color": "FFFFFF", "profile_image_url_https": "https://pbs.twimg.com/profile_images/693009922846515200/dzwB3rPe_normal.jpg", "geo_enabled": false, "time_zone": "Dublin", "name": "L\u0131\u0103m", "id_str": "13148", "entities": {"description": {"urls": []}, "url": {"urls": [{"display_url": "liamcooke.com", "indices": [0, 23], "expanded_url": "http://liamcooke.com", "url": "https://t.co/Wz4bls6kQh"}]}}, "is_translator": false, "screen_name": "inky", "created_at": "Mon Nov 20 00:04:50 +0000 2006"}, "id_str": "189643778", "id": 189643778, "following": true, "full_name": "@inky/space-bots", "created_at": "Thu Jan 22 21:35:25 +0000 2015", "uri": "/inky/lists/space-bots"}], "next_cursor": 0, "previous_cursor_str": "0", "next_cursor_str": "0", "previous_cursor": 0} -------------------------------------------------------------------------------- /testdata/get_help_configuration.json: -------------------------------------------------------------------------------- 1 | {"dm_text_character_limit": 10000,"characters_reserved_per_media": 24,"max_media_per_upload": 1,"non_username_paths": ["about","account","accounts","activity","all","announcements","anywhere","api_rules","api_terms","apirules","apps","auth","badges","blog","business","buttons","contacts","devices","direct_messages","download","downloads","edit_announcements","faq","favorites","find_sources","find_users","followers","following","friend_request","friendrequest","friends","goodies","help","home","i","im_account","inbox","invitations","invite","jobs","list","login","logo","logout","me","mentions","messages","mockview","newtwitter","notifications","nudge","oauth","phoenix_search","positions","privacy","public_timeline","related_tweets","replies","retweeted_of_mine","retweets","retweets_by_others","rules","saved_searches","search","sent","sessions","settings","share","signup","signin","similar_to","statistics","terms","tos","translate","trends","tweetbutton","twttr","update_discoverability","users","welcome","who_to_follow","widgets","zendesk_auth","media_signup"],"photo_size_limit": 3145728,"photo_sizes": {"thumb": {"h": 150,"resize": "crop","w": 150},"small": {"h": 480,"resize": "fit","w": 340},"medium": {"h": 1200,"resize": "fit","w": 600},"large": {"h": 2048,"resize": "fit","w": 1024}},"short_url_length": 23,"short_url_length_https": 23} -------------------------------------------------------------------------------- /testdata/get_incoming_friendships.json: -------------------------------------------------------------------------------- 1 | {"previous_cursor_str": "0", "next_cursor": 0, "previous_cursor": 0, "ids": [12], "next_cursor_str": "0"} 2 | -------------------------------------------------------------------------------- /testdata/get_lists.json: -------------------------------------------------------------------------------- 1 | {"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0","lists":[{"id":229581524,"id_str":"229581524","name":"test","uri":"\/notinourselves\/lists\/test","subscriber_count":0,"member_count":1,"mode":"public","description":"","slug":"test","full_name":"@notinourselves\/test","created_at":"Fri Dec 18 20:00:45 +0000 2015","following":true,"user":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":1,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":25,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false}}]} -------------------------------------------------------------------------------- /testdata/get_lists_list.json: -------------------------------------------------------------------------------- 1 | [{"id":189643778,"id_str":"189643778","name":"space bots","uri":"\/inky\/lists\/space-bots","subscriber_count":2,"member_count":10,"mode":"public","description":"\u2728\ud83c\udf0c\u2728","slug":"space-bots","full_name":"@inky\/space-bots","created_at":"Thu Jan 22 21:35:25 +0000 2015","following":true,"user":{"id":13148,"id_str":"13148","name":"Liam","screen_name":"inky","location":"Dublin, Ireland","description":"ambient music + art bots","url":"https:\/\/t.co\/Wz4bls6kQh","entities":{"url":{"urls":[{"url":"https:\/\/t.co\/Wz4bls6kQh","expanded_url":"http:\/\/liamcooke.com","display_url":"liamcooke.com","indices":[0,23]}]},"description":{"urls":[]}},"protected":false,"followers_count":1587,"friends_count":902,"listed_count":104,"created_at":"Mon Nov 20 00:04:50 +0000 2006","favourites_count":65041,"utc_offset":0,"time_zone":"Dublin","geo_enabled":false,"verified":false,"statuses_count":26258,"lang":"en-gb","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"EDEDF4","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/628878668\/zwcd99eo8b13p4wpbv2a.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/628878668\/zwcd99eo8b13p4wpbv2a.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/660938666668384256\/goDqCydt_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/660938666668384256\/goDqCydt_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/13148\/1447542687","profile_link_color":"848484","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"C0DFEC","profile_text_color":"333333","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false}}] -------------------------------------------------------------------------------- /testdata/get_mutes_users_ids.json: -------------------------------------------------------------------------------- 1 | {"ids": [6385432], "next_cursor_str": "0", "previous_cursor_str": "0", "next_cursor": 0, "previous_cursor": 0} -------------------------------------------------------------------------------- /testdata/get_mutes_users_ids_loop_0.json: -------------------------------------------------------------------------------- 1 | {"ids": [129612549, 745832401, 3418148782, 1957463503, 2961286252, 846134299, 2311078998, 2169047207, 3648628344, 3422628629, 364621145, 1925504714, 715588897871372290, 3283496976, 2957187500, 151867999, 1663093753, 526554566, 499203061, 302458717, 67547362, 211413815, 713671180096393216, 2855278543, 42013736, 2282516562, 843048714, 2335398504, 1652075268, 113693559, 189537010, 960296839, 45775135, 120376864, 165688313, 341429354, 269402975, 3307718191, 3239466194, 147977998, 602700564, 561420144, 1552510458, 719564717153329152, 394146145, 1404360181, 344152954, 1251030710, 57947109, 180540375], "next_cursor_str": "1535206520056565155", "previous_cursor_str": "0", "next_cursor": 1535206520056565155, "previous_cursor": 0} -------------------------------------------------------------------------------- /testdata/get_mutes_users_ids_loop_1.json: -------------------------------------------------------------------------------- 1 | {"ids": [174144887, 175264457, 779116838, 4718721250, 56032511, 198337759, 48290966, 2572268096, 364487087, 213151008, 2938277331, 1271082936, 2271115976, 14408999, 17197784, 34556109, 2531159968, 1674083671, 1650310652, 2572531545, 1451921947, 729493049852694529, 707764649173897216, 1650681522, 2573225349, 2569229674, 4866699178, 4461399201, 1609833792, 700228367, 1418745782, 6385432], "next_cursor_str": "0", "previous_cursor_str": "-1535206508490832356", "next_cursor": 0, "previous_cursor": -1535206508490832356} -------------------------------------------------------------------------------- /testdata/get_mutes_users_list.json: -------------------------------------------------------------------------------- 1 | {"next_cursor_str": "0", "previous_cursor_str": "0", "next_cursor": 0, "users": [{"profile_image_url_https": "https://pbs.twimg.com/profile_images/694413957868625920/PZNI3yPX_normal.jpg", "statuses_count": 9975, "profile_text_color": "333333", "protected": false, "is_translator": false, "profile_background_color": "C0DEED", "favourites_count": 5650, "contributors_enabled": false, "default_profile": true, "following": false, "default_profile_image": false, "has_extended_profile": false, "blocking": false, "time_zone": "Central Time (US & Canada)", "location": "San Francisco", "utc_offset": -18000, "id_str": "6385432", "is_translation_enabled": false, "id": 6385432, "profile_link_color": "0084B4", "entities": {"description": {"urls": []}}, "url": null, "followers_count": 1642903, "notifications": false, "profile_sidebar_fill_color": "DDEEF6", "screen_name": "dickc", "geo_enabled": true, "status": {"source": "Twitter for iPhone", "coordinates": null, "geo": null, "retweet_count": 0, "created_at": "Mon May 23 04:10:47 +0000 2016", "in_reply_to_status_id_str": "734414308340178946", "in_reply_to_screen_name": "kpk", "place": null, "favorite_count": 3, "in_reply_to_user_id_str": "22915745", "is_quote_status": false, "id_str": "734597416914157568", "in_reply_to_status_id": 734414308340178946, "lang": "en", "favorited": false, "text": "@kpk no not hilly. Very flat for the most part. A couples up and down bumps but nothing horrible. No, I don't like running after about 5k", "truncated": false, "in_reply_to_user_id": 22915745, "contributors": null, "retweeted": false, "id": 734597416914157568, "entities": {"symbols": [], "urls": [], "user_mentions": [{"indices": [0, 4], "name": "Kenneth", "id": 22915745, "screen_name": "kpk", "id_str": "22915745"}], "hashtags": []}}, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "verified": true, "profile_background_tile": false, "muting": true, "listed_count": 9232, "blocked_by": false, "description": "", "lang": "en", "name": "dick costolo", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_banner_url": "https://pbs.twimg.com/profile_banners/6385432/1347981884", "profile_image_url": "http://pbs.twimg.com/profile_images/694413957868625920/PZNI3yPX_normal.jpg", "created_at": "Mon May 28 13:26:41 +0000 2007", "friends_count": 617, "follow_request_sent": false, "profile_sidebar_border_color": "C0DEED", "profile_use_background_image": true}], "previous_cursor": 0} -------------------------------------------------------------------------------- /testdata/get_outgoing_friendships.json: -------------------------------------------------------------------------------- 1 | {"previous_cursor_str": "0", "next_cursor": 0, "previous_cursor": 0, "ids": [12], "next_cursor_str": "0"} 2 | -------------------------------------------------------------------------------- /testdata/get_retweeters.json: -------------------------------------------------------------------------------- 1 | {"ids":[2495447557,2329303118,400773576,2951536813,2354858683,2805218958,2921074850,717950795,2920198337,2298780054,2956277463,2932914681,594152187,2149827450,1280652686,255149618,2253500994,1154184554,1028143183,2959583048,2812607934,2950529331,2228419408,2209549874,2271602339,506047908,1321986698,1678837003,1377602034,1391372328,876733711,2810075863,1092858866,1190783960,1462374198,2601544682,2904210737,2974097771,2954764264,2174326285,2579330610,2312150604,2935300107,2880845950,2491777656,2904960699,2504816257,2792158449,2966376340,2923958981,487115006,1666454508,1155588638,2937463192,1701275521,87824707,2831786788,738630438,2920496680,1260643814,542483377,173699661,2921547653],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"} -------------------------------------------------------------------------------- /testdata/get_retweets_of_me.json: -------------------------------------------------------------------------------- 1 | [{"source": "Tweetbot for i\u039fS", "entities": {"hashtags": [], "symbols": [], "user_mentions": [], "urls": []}, "in_reply_to_user_id_str": null, "lang": "en", "in_reply_to_status_id": null, "favorite_count": 3, "text": "These announcers yo \ud83d\ude21", "retweet_count": 1, "is_quote_status": false, "geo": null, "in_reply_to_user_id": null, "contributors": null, "id": 960340958003986432, "truncated": false, "in_reply_to_screen_name": null, "place": null, "user": {"profile_sidebar_border_color": "000000", "friends_count": 496, "utc_offset": -18000, "notifications": false, "profile_background_color": "FFFFFF", "listed_count": 6, "time_zone": "Eastern Time (US & Canada)", "profile_background_tile": false, "name": "Trolley Appreciator", "entities": {"description": {"urls": []}, "url": {"urls": [{"indices": [0, 23], "expanded_url": "http://iseverythingstilltheworst.com", "url": "https://t.co/wtg3XyA3vL", "display_url": "iseverythingstilltheworst.com"}]}}, "description": "these people have addresses | #botally", "lang": "en", "favourites_count": 20423, "verified": false, "protected": true, "statuses_count": 4022, "profile_banner_url": "https://pbs.twimg.com/profile_banners/372018022/1475799101", "created_at": "Sun Sep 11 23:49:28 +0000 2011", "screen_name": "__jcbl__", "profile_link_color": "EE3355", "has_extended_profile": false, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "geo_enabled": false, "profile_sidebar_fill_color": "000000", "id": 372018022, "is_translation_enabled": false, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "following": false, "url": "https://t.co/wtg3XyA3vL", "default_profile_image": false, "id_str": "372018022", "profile_use_background_image": false, "default_profile": false, "translator_type": "none", "is_translator": false, "location": "philly", "profile_image_url": "http://pbs.twimg.com/profile_images/958783522008915969/brQwSHU7_normal.jpg", "contributors_enabled": false, "followers_count": 190, "profile_text_color": "000000", "follow_request_sent": false, "profile_image_url_https": "https://pbs.twimg.com/profile_images/958783522008915969/brQwSHU7_normal.jpg"}, "id_str": "960340958003986432", "retweeted": true, "created_at": "Mon Feb 05 02:35:01 +0000 2018", "in_reply_to_status_id_str": null, "favorited": false, "coordinates": null}] -------------------------------------------------------------------------------- /testdata/get_search.json: -------------------------------------------------------------------------------- 1 | {"statuses":[{"metadata":{"result_type":"popular","iso_language_code":"en"},"created_at":"Tue Dec 08 21:40:00 +0000 2015","id":674342688083283970,"id_str":"674342688083283970","text":"\ud83c\udfb6 C++, Java, Python & Ruby. These are a few of my favorite things \ud83c\udfb6 #HourOfCode \ud83d\udd51\ud83d\udcbb\ud83d\udc7e\ud83c\udfae https:\/\/t.co\/GSCmPh9V6j","source":"\u003ca href=\"https:\/\/vine.co\" rel=\"nofollow\"\u003eVine for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":58309829,"id_str":"58309829","name":"Nickelodeon","screen_name":"NickelodeonTV","location":"USA","description":"The Official Twitter for Nickelodeon, USA!","url":"https:\/\/t.co\/Lz9i6LdC4f","entities":{"url":{"urls":[{"url":"https:\/\/t.co\/Lz9i6LdC4f","expanded_url":"http:\/\/www.nick.com","display_url":"nick.com","indices":[0,23]}]},"description":{"urls":[]}},"protected":false,"followers_count":3914587,"friends_count":2263,"listed_count":3321,"created_at":"Sun Jul 19 22:19:02 +0000 2009","favourites_count":2757,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":true,"verified":true,"statuses_count":33910,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":true,"profile_background_color":"FA743E","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/450718163508789248\/E26KBqrx.jpeg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/450718163508789248\/E26KBqrx.jpeg","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/671387650792665088\/sJxvItMD_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/671387650792665088\/sJxvItMD_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/58309829\/1448906254","profile_link_color":"D1771E","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"F0F0F0","profile_text_color":"333333","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":28,"favorite_count":126,"entities":{"hashtags":[{"text":"HourOfCode","indices":[72,83]}],"symbols":[],"user_mentions":[],"urls":[{"url":"https:\/\/t.co\/GSCmPh9V6j","expanded_url":"https:\/\/vine.co\/v\/i7QJji9Ldmr","display_url":"vine.co\/v\/i7QJji9Ldmr","indices":[89,112]}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"}]} -------------------------------------------------------------------------------- /testdata/get_show_friendship.json: -------------------------------------------------------------------------------- 1 | {"relationship":{"source":{"id":4012966701,"id_str":"4012966701","screen_name":"notinourselves","following":true,"followed_by":true,"live_following":false,"following_received":false,"following_requested":false,"notifications_enabled":false,"can_dm":true,"blocking":false,"blocked_by":false,"muting":false,"want_retweets":true,"all_replies":false,"marked_spam":false},"target":{"id":372018022,"id_str":"372018022","screen_name":"__jcbl__","following":true,"followed_by":true,"following_received":false,"following_requested":false}}} -------------------------------------------------------------------------------- /testdata/get_show_subscription.json: -------------------------------------------------------------------------------- 1 | {"notifications": false, "profile_use_background_image": false, "has_extended_profile": false, "listed_count": 5, "profile_image_url": "http://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "verified": false, "lang": "en", "protected": false, "url": "http://t.co/wtg3XzqQTX", "statuses_count": 325, "profile_text_color": "000000", "profile_background_tile": false, "follow_request_sent": false, "id": 372018022, "default_profile_image": false, "contributors_enabled": false, "following": true, "profile_link_color": "EE3355", "followers_count": 49, "friends_count": 306, "location": "not a very good kingdom tbh", "description": "my kingdom for a microwave that doesn't beep", "profile_sidebar_fill_color": "000000", "default_profile": false, "utc_offset": -18000, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "favourites_count": 1279, "profile_background_color": "FFFFFF", "is_translation_enabled": false, "profile_sidebar_border_color": "000000", "profile_image_url_https": "https://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "geo_enabled": false, "time_zone": "Eastern Time (US & Canada)", "name": "jeremy", "id_str": "372018022", "entities": {"description": {"urls": []}, "url": {"urls": [{"display_url": "iseverythingstilltheworst.com", "indices": [0, 22], "expanded_url": "http://iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX"}]}}, "status": {"coordinates": null, "is_quote_status": true, "geo": null, "retweet_count": 0, "lang": "en", "truncated": false, "id": 692770919693979649, "place": null, "favorite_count": 0, "possibly_sensitive": false, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_status_id": null, "in_reply_to_screen_name": null, "text": "These are so good https://t.co/WIvl27xWGh", "quoted_status_id": 692612860636205056, "id_str": "692770919693979649", "entities": {"hashtags": [], "urls": [{"display_url": "twitter.com/NotAllBhas/sta\u2026", "indices": [18, 41], "expanded_url": "https://twitter.com/NotAllBhas/status/692769889560498180", "url": "https://t.co/WIvl27xWGh"}], "symbols": [], "user_mentions": []}, "source": "Talon (Plus)", "contributors": null, "favorited": false, "quoted_status_id_str": "692612860636205056", "in_reply_to_user_id_str": null, "retweeted": false, "created_at": "Thu Jan 28 18:07:12 +0000 2016"}, "is_translator": false, "screen_name": "__jcbl__", "created_at": "Sun Sep 11 23:49:28 +0000 2011"} -------------------------------------------------------------------------------- /testdata/get_show_subscription_extra_params.json: -------------------------------------------------------------------------------- 1 | {"notifications": false, "profile_use_background_image": false, "has_extended_profile": false, "listed_count": 5, "profile_image_url": "http://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "verified": false, "lang": "en", "protected": false, "url": "http://t.co/wtg3XzqQTX", "statuses_count": 325, "profile_text_color": "000000", "profile_background_tile": false, "follow_request_sent": false, "id": 372018022, "default_profile_image": false, "contributors_enabled": false, "following": true, "profile_link_color": "EE3355", "followers_count": 49, "friends_count": 306, "location": "not a very good kingdom tbh", "description": "my kingdom for a microwave that doesn't beep", "profile_sidebar_fill_color": "000000", "default_profile": false, "utc_offset": -18000, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "favourites_count": 1279, "profile_background_color": "FFFFFF", "is_translation_enabled": false, "profile_sidebar_border_color": "000000", "profile_image_url_https": "https://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "geo_enabled": false, "time_zone": "Eastern Time (US & Canada)", "name": "jeremy", "id_str": "372018022", "entities": {"description": {"urls": []}, "url": {"urls": [{"display_url": "iseverythingstilltheworst.com", "indices": [0, 22], "expanded_url": "http://iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX"}]}}, "is_translator": false, "screen_name": "__jcbl__", "created_at": "Sun Sep 11 23:49:28 +0000 2011"} -------------------------------------------------------------------------------- /testdata/get_show_subscription_not_subscriber.json: -------------------------------------------------------------------------------- 1 | {"errors": [{"message": "The specified user is not a subscriber of this list.", "code": 109}]} -------------------------------------------------------------------------------- /testdata/get_status.json: -------------------------------------------------------------------------------- 1 | {"created_at":"Sun Mar 26 19:17:08 +0000 2006","id":397,"id_str":"397","text":"getting waxed!","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":12,"id_str":"12","name":"Jack","screen_name":"jack","location":"California, USA","description":"#withMalala!","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3278945,"friends_count":1726,"listed_count":25294,"created_at":"Tue Mar 21 20:50:14 +0000 2006","favourites_count":9126,"utc_offset":-28800,"time_zone":"Pacific Time (US & Canada)","geo_enabled":true,"verified":true,"statuses_count":18013,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"EBEBEB","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme7\/bg.gif","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/668328458519384064\/FSAIjKRl_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/668328458519384064\/FSAIjKRl_normal.jpg","profile_link_color":"990000","profile_sidebar_border_color":"DFDFDF","profile_sidebar_fill_color":"F3F3F3","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":153,"favorite_count":167,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"} -------------------------------------------------------------------------------- /testdata/get_status_extra_params.json: -------------------------------------------------------------------------------- 1 | {"created_at": "Sun Mar 26 19:17:08 +0000 2006","in_reply_to_user_id_str": null,"contributors": null,"source": "Twitter Web Client","truncated": false,"text": "getting waxed!","favorited": false,"in_reply_to_screen_name": null,"coordinates": null,"id": 397,"place": null,"retweet_count": 152,"in_reply_to_status_id_str": null,"retweeted": false,"in_reply_to_status_id": null,"user": {"id": 12,"id_str": "12"},"lang": "en","id_str": "397","in_reply_to_user_id": null,"favorite_count": 168,"geo": null,"is_quote_status": false} -------------------------------------------------------------------------------- /testdata/get_status_oembed.json: -------------------------------------------------------------------------------- 1 | {"cache_age":"3153600000","url":"https:\/\/twitter.com\/jack\/statuses\/397","height":null,"provider_url":"https:\/\/twitter.com","provider_name":"Twitter","author_name":"Jack","version":"1.0","author_url":"https:\/\/twitter.com\/jack","type":"rich","html":"\u003Cblockquote class=\"twitter-tweet\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003Egetting waxed!\u003C\/p\u003E— Jack (@jack) \u003Ca href=\"https:\/\/twitter.com\/jack\/status\/397\"\u003EMarch 26, 2006\u003C\/a\u003E\u003C\/blockquote\u003E\n\u003Cscript async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"\u003E\u003C\/script\u003E","width":550} -------------------------------------------------------------------------------- /testdata/get_statuses.2.json: -------------------------------------------------------------------------------- 1 | [{"contributors": null, "truncated": false, "text": "just setting up my twttr", "is_quote_status": false, "in_reply_to_status_id": null, "id": 20, "favorite_count": 76282, "source": "Twitter Web Client", "retweeted": false, "coordinates": null, "entities": {"symbols": [], "user_mentions": [], "hashtags": [], "urls": []}, "in_reply_to_screen_name": null, "in_reply_to_user_id": null, "retweet_count": 103721, "id_str": "20", "favorited": false, "user": {"follow_request_sent": false, "has_extended_profile": true, "profile_use_background_image": true, "default_profile_image": false, "id": 12, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "verified": true, "translator_type": "regular", "profile_text_color": "333333", "profile_image_url_https": "https://pbs.twimg.com/profile_images/839863609345794048/mkpdB9Tf_normal.jpg", "profile_sidebar_fill_color": "F3F3F3", "entities": {"description": {"urls": []}}, "followers_count": 4039047, "profile_sidebar_border_color": "DFDFDF", "id_str": "12", "profile_background_color": "EBEBEB", "listed_count": 27178, "is_translation_enabled": false, "utc_offset": -25200, "statuses_count": 21829, "description": "", "friends_count": 2696, "location": "California, USA", "profile_link_color": "990000", "profile_image_url": "http://pbs.twimg.com/profile_images/839863609345794048/mkpdB9Tf_normal.jpg", "following": false, "geo_enabled": true, "profile_banner_url": "https://pbs.twimg.com/profile_banners/12/1483046077", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "screen_name": "jack", "lang": "en", "profile_background_tile": false, "favourites_count": 16961, "name": "jack", "notifications": false, "url": null, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "contributors_enabled": false, "time_zone": "Pacific Time (US & Canada)", "protected": false, "default_profile": false, "is_translator": false}, "geo": null, "in_reply_to_user_id_str": null, "lang": "en", "created_at": "Tue Mar 21 20:50:14 +0000 2006", "in_reply_to_status_id_str": null, "place": null}] 2 | -------------------------------------------------------------------------------- /testdata/get_statuses.ids.txt: -------------------------------------------------------------------------------- 1 | 724 2 | 701 3 | 691 4 | 690 5 | 689 6 | 688 7 | 687 8 | 686 9 | 685 10 | 674 11 | 673 12 | 668 13 | 662 14 | 660 15 | 654 16 | 651 17 | 650 18 | 643 19 | 637 20 | 636 21 | 634 22 | 623 23 | 614 24 | 596 25 | 594 26 | 593 27 | 592 28 | 581 29 | 579 30 | 567 31 | 566 32 | 564 33 | 555 34 | 544 35 | 541 36 | 540 37 | 538 38 | 536 39 | 517 40 | 507 41 | 501 42 | 495 43 | 493 44 | 487 45 | 477 46 | 475 47 | 465 48 | 463 49 | 453 50 | 447 51 | 443 52 | 438 53 | 435 54 | 432 55 | 397 56 | 387 57 | 376 58 | 364 59 | 356 60 | 348 61 | 346 62 | 342 63 | 323 64 | 317 65 | 314 66 | 305 67 | 302 68 | 291 69 | 289 70 | 287 71 | 267 72 | 251 73 | 247 74 | 245 75 | 243 76 | 240 77 | 239 78 | 222 79 | 198 80 | 176 81 | 174 82 | 170 83 | 166 84 | 163 85 | 155 86 | 153 87 | 152 88 | 137 89 | 132 90 | 129 91 | 117 92 | 113 93 | 101 94 | 92 95 | 89 96 | 81 97 | 62 98 | 51 99 | 35 100 | 29 101 | 20 102 | -------------------------------------------------------------------------------- /testdata/get_statuses.map.2.json: -------------------------------------------------------------------------------- 1 | {"id": {"20": {"contributors": null, "truncated": false, "text": "just setting up my twttr", "is_quote_status": false, "in_reply_to_status_id": null, "id": 20, "favorite_count": 76284, "source": "Twitter Web Client", "retweeted": false, "coordinates": null, "entities": {"symbols": [], "user_mentions": [], "hashtags": [], "urls": []}, "in_reply_to_screen_name": null, "in_reply_to_user_id": null, "retweet_count": 103722, "id_str": "20", "favorited": false, "user": {"follow_request_sent": false, "has_extended_profile": true, "profile_use_background_image": true, "default_profile_image": false, "id": 12, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "verified": true, "translator_type": "regular", "profile_text_color": "333333", "profile_image_url_https": "https://pbs.twimg.com/profile_images/839863609345794048/mkpdB9Tf_normal.jpg", "profile_sidebar_fill_color": "F3F3F3", "entities": {"description": {"urls": []}}, "followers_count": 4039068, "profile_sidebar_border_color": "DFDFDF", "id_str": "12", "profile_background_color": "EBEBEB", "listed_count": 27172, "is_translation_enabled": false, "utc_offset": -25200, "statuses_count": 21829, "description": "", "friends_count": 2696, "location": "California, USA", "profile_link_color": "990000", "profile_image_url": "http://pbs.twimg.com/profile_images/839863609345794048/mkpdB9Tf_normal.jpg", "following": false, "geo_enabled": true, "profile_banner_url": "https://pbs.twimg.com/profile_banners/12/1483046077", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "screen_name": "jack", "lang": "en", "profile_background_tile": false, "favourites_count": 16961, "name": "jack", "notifications": false, "url": null, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "contributors_enabled": false, "time_zone": "Pacific Time (US & Canada)", "protected": false, "default_profile": false, "is_translator": false}, "geo": null, "in_reply_to_user_id_str": null, "lang": "en", "created_at": "Tue Mar 21 20:50:14 +0000 2006", "in_reply_to_status_id_str": null, "place": null}}} 2 | -------------------------------------------------------------------------------- /testdata/get_trends_woeid_exclude.json: -------------------------------------------------------------------------------- 1 | [{"trends":[{"name":"Duette","url":"http:\/\/twitter.com\/search?q=Duette","promoted_content":null,"query":"Duette","tweet_volume":null},{"name":"Adam Driver","url":"http:\/\/twitter.com\/search?q=%22Adam+Driver%22","promoted_content":null,"query":"%22Adam+Driver%22","tweet_volume":19117},{"name":"Siesta Key","url":"http:\/\/twitter.com\/search?q=%22Siesta+Key%22","promoted_content":null,"query":"%22Siesta+Key%22","tweet_volume":null},{"name":"Rayo","url":"http:\/\/twitter.com\/search?q=Rayo","promoted_content":null,"query":"Rayo","tweet_volume":16112},{"name":"Tornado Warning","url":"http:\/\/twitter.com\/search?q=%22Tornado+Warning%22","promoted_content":null,"query":"%22Tornado+Warning%22","tweet_volume":null},{"name":"Corbyn","url":"http:\/\/twitter.com\/search?q=Corbyn","promoted_content":null,"query":"Corbyn","tweet_volume":28709},{"name":"Dhoni","url":"http:\/\/twitter.com\/search?q=Dhoni","promoted_content":null,"query":"Dhoni","tweet_volume":24235},{"name":"So Future","url":"http:\/\/twitter.com\/search?q=%22So+Future%22","promoted_content":null,"query":"%22So+Future%22","tweet_volume":null},{"name":"Meek","url":"http:\/\/twitter.com\/search?q=Meek","promoted_content":null,"query":"Meek","tweet_volume":252346},{"name":"Chiefs","url":"http:\/\/twitter.com\/search?q=Chiefs","promoted_content":null,"query":"Chiefs","tweet_volume":274640},{"name":"Brady","url":"http:\/\/twitter.com\/search?q=Brady","promoted_content":null,"query":"Brady","tweet_volume":264675},{"name":"Greg","url":"http:\/\/twitter.com\/search?q=Greg","promoted_content":null,"query":"Greg","tweet_volume":153857},{"name":"Aaliyah","url":"http:\/\/twitter.com\/search?q=Aaliyah","promoted_content":null,"query":"Aaliyah","tweet_volume":162055},{"name":"Jeff Janis","url":"http:\/\/twitter.com\/search?q=%22Jeff+Janis%22","promoted_content":null,"query":"%22Jeff+Janis%22","tweet_volume":33813},{"name":"Eddie Lacy","url":"http:\/\/twitter.com\/search?q=%22Eddie+Lacy%22","promoted_content":null,"query":"%22Eddie+Lacy%22","tweet_volume":25529}],"as_of":"2016-01-17T12:34:48Z","created_at":"2016-01-17T12:30:46Z","locations":[{"name":"New York","woeid":2459115}]}] -------------------------------------------------------------------------------- /testdata/get_user.json: -------------------------------------------------------------------------------- 1 | {"id":718443,"id_str":"718443","name":"Kesuke Miyagi","screen_name":"kesuke","location":"Okinawa, Japan","profile_location":null,"description":"\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":22,"friends_count":1,"listed_count":6,"created_at":"Sun Jan 28 06:31:55 +0000 2007","favourites_count":0,"utc_offset":32400,"time_zone":"Tokyo","geo_enabled":false,"verified":false,"statuses_count":10,"lang":"en","status":{"created_at":"Mon Jul 07 13:10:40 +0000 2014","id":486135208928751616,"id_str":"486135208928751616","text":"Wax on.","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"9AE4E8","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/21525032\/kesuke_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/21525032\/kesuke_normal.png","profile_link_color":"0000FF","profile_sidebar_border_color":"87BC44","profile_sidebar_fill_color":"E0FF92","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false} -------------------------------------------------------------------------------- /testdata/get_user_suggestion_categories.json: -------------------------------------------------------------------------------- 1 | [{"size":26,"slug":"sports","name":"Sports"},{"size":11,"slug":"television","name":"Television"},{"size":15,"slug":"music","name":"Music"},{"size":15,"slug":"entertainment","name":"Entertainment"},{"size":14,"slug":"funny","name":"Funny"},{"size":15,"slug":"news","name":"News"},{"size":15,"slug":"fashion","name":"Fashion"},{"size":15,"slug":"food-drink","name":"Food & Drink"},{"size":9,"slug":"family","name":"Family"},{"size":9,"slug":"business","name":"Business"},{"size":10,"slug":"books","name":"Books"},{"size":15,"slug":"government","name":"Government"},{"size":12,"slug":"leaders","name":"Leaders"},{"size":12,"slug":"influencers","name":"Influencers"},{"size":15,"slug":"gaming","name":"Gaming"}] -------------------------------------------------------------------------------- /testdata/get_verify_credentials_include_email.json: -------------------------------------------------------------------------------- 1 | {"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","email":"test@example.com","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":2,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":false,"statuses_count":83,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/736320724164448256\/LgaAQoav.jpg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/736320724164448256\/LgaAQoav.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/4012966701\/1453123196","profile_link_color":"000000","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false} -------------------------------------------------------------------------------- /testdata/lookup_friendship.json: -------------------------------------------------------------------------------- 1 | [{"name":"Kesuke Miyagi","screen_name":"kesuke","id":718443,"id_str":"718443","connections":["none"]}] -------------------------------------------------------------------------------- /testdata/media/happy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/testdata/media/happy.jpg -------------------------------------------------------------------------------- /testdata/models/models_category.json: -------------------------------------------------------------------------------- 1 | {"size":26,"slug":"sports","name":"Sports"} -------------------------------------------------------------------------------- /testdata/models/models_direct_message_short.json: -------------------------------------------------------------------------------- 1 | {"id":678629245946433539,"id_str":"678629245946433539","text":"The Communists are distinguished from the other working-class parties by this only","sender":{"id":372018022,"id_str":"372018022","name":"jeremy","screen_name":"__jcbl__","location":"not a very good kingdom tbh","description":"my kingdom for a microwave that doesn't beep","url":"http:\/\/t.co\/wtg3XzqQTX","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/wtg3XzqQTX","expanded_url":"http:\/\/iseverythingstilltheworst.com","display_url":"iseverythingstilltheworst.com","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":51,"friends_count":289,"listed_count":5,"created_at":"Sun Sep 11 23:49:28 +0000 2011","favourites_count":1245,"utc_offset":-18000,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":312,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"FFFFFF","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/659691753826615298\/yN1SoWrU_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/659691753826615298\/yN1SoWrU_normal.jpg","profile_link_color":"EE3355","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":true,"follow_request_sent":false,"notifications":false},"sender_id":372018022,"sender_id_str":"372018022","sender_screen_name":"__jcbl__","recipient":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":1,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":25,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"recipient_id":4012966701,"recipient_id_str":"4012966701","recipient_screen_name":"notinourselves","created_at":"Sun Dec 20 17:33:15 +0000 2015","entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[{"url":"https:\/\/t.co\/PnDU7HQGwq","expanded_url":"http:\/\/twitter.com\/pattymo\/status\/674659346127679488","display_url":"twitter.com\/pattymo\/status\u2026","indices":[0,23]}]}} -------------------------------------------------------------------------------- /testdata/models/models_hashtag.json: -------------------------------------------------------------------------------- 1 | {"text":"python","indices":[5,12]} -------------------------------------------------------------------------------- /testdata/models/models_list.json: -------------------------------------------------------------------------------- 1 | {"id":229581524,"id_str":"229581524","name":"test","uri":"\/notinourselves\/lists\/test","subscriber_count":0,"member_count":1,"mode":"public","description":"","slug":"test","full_name":"@notinourselves\/test","created_at":"Fri Dec 18 20:00:45 +0000 2015","following":true,"user":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":1,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":25,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false}} -------------------------------------------------------------------------------- /testdata/models/models_media.json: -------------------------------------------------------------------------------- 1 | {"display_url": "pic.twitter.com/NWg4YmiZKA", "expanded_url": "http://twitter.com/himawari8bot/status/698657677329752065/photo/1", "id": 698657676939685888, "media_url": "http://pbs.twimg.com/tweet_video_thumb/CbIhdJ2W8AASWjq.jpg", "media_url_https": "https://pbs.twimg.com/tweet_video_thumb/CbIhdJ2W8AASWjq.jpg", "type": "animated_gif", "url": "https://t.co/NWg4YmiZKA"} -------------------------------------------------------------------------------- /testdata/models/models_status_no_user.json: -------------------------------------------------------------------------------- 1 | {"extended_entities": {"media": [{"media_url": "http://pbs.twimg.com/tweet_video_thumb/CbIhdJ2W8AASWjq.jpg", "url": "https://t.co/NWg4YmiZKA", "indices": [20, 43], "id": 698657676939685888, "media_url_https": "https://pbs.twimg.com/tweet_video_thumb/CbIhdJ2W8AASWjq.jpg", "expanded_url": "http://twitter.com/himawari8bot/status/698657677329752065/photo/1", "sizes": {"large": {"w": 450, "h": 458, "resize": "fit"}, "medium": {"w": 450, "h": 458, "resize": "fit"}, "thumb": {"w": 150, "h": 150, "resize": "crop"}, "small": {"w": 340, "h": 346, "resize": "fit"}}, "display_url": "pic.twitter.com/NWg4YmiZKA", "video_info": {"aspect_ratio": [225, 229], "variants": [{"url": "https://pbs.twimg.com/tweet_video/CbIhdJ2W8AASWjq.mp4", "bitrate": 0, "content_type": "video/mp4"}]}, "id_str": "698657676939685888", "type": "animated_gif"}]}, "retweet_count": 2, "source": "space, jerks.", "created_at": "Sat Feb 13 23:59:05 +0000 2016", "in_reply_to_user_id": null, "id": 698657677329752065, "coordinates": null, "id_str": "698657677329752065", "in_reply_to_user_id_str": null, "place": null, "in_reply_to_screen_name": null, "possibly_sensitive": false, "is_quote_status": false, "in_reply_to_status_id_str": null, "favorite_count": 0, "contributors": null, "favorited": false, "text": "2016-02-13T23:00:00 https://t.co/NWg4YmiZKA", "lang": "und", "retweeted": false, "entities": {"hashtags": [], "symbols": [], "user_mentions": [], "urls": [], "media": [{"media_url": "http://pbs.twimg.com/tweet_video_thumb/CbIhdJ2W8AASWjq.jpg", "url": "https://t.co/NWg4YmiZKA", "indices": [20, 43], "id": 698657676939685888, "media_url_https": "https://pbs.twimg.com/tweet_video_thumb/CbIhdJ2W8AASWjq.jpg", "expanded_url": "http://twitter.com/himawari8bot/status/698657677329752065/photo/1", "sizes": {"large": {"w": 450, "h": 458, "resize": "fit"}, "medium": {"w": 450, "h": 458, "resize": "fit"}, "thumb": {"w": 150, "h": 150, "resize": "crop"}, "small": {"w": 340, "h": 346, "resize": "fit"}}, "display_url": "pic.twitter.com/NWg4YmiZKA", "id_str": "698657676939685888", "type": "photo"}]}, "truncated": false, "in_reply_to_status_id": null, "geo": null} -------------------------------------------------------------------------------- /testdata/models/models_trend.json: -------------------------------------------------------------------------------- 1 | {"name":"#ChangeAConsonantSpoilAMovie","url":"http:\\/\\/twitter.com\\/search?q=%23ChangeAConsonantSpoilAMovie","promoted_content":null,"query":"%23ChangeAConsonantSpoilAMovie","tweet_volume":104403} -------------------------------------------------------------------------------- /testdata/models/models_url.json: -------------------------------------------------------------------------------- 1 | {"url":"http:\/\/t.co\/wtg3XzqQTX","expanded_url":"http:\/\/iseverythingstilltheworst.com","display_url":"iseverythingstilltheworst.com","indices":[0,22]} -------------------------------------------------------------------------------- /testdata/models/models_user.json: -------------------------------------------------------------------------------- 1 | {"id":718443,"id_str":"718443","name":"Kesuke Miyagi","screen_name":"kesuke","location":"Okinawa, Japan","profile_location":null,"description":"\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":22,"friends_count":1,"listed_count":6,"created_at":"Sun Jan 28 06:31:55 +0000 2007","favourites_count":0,"utc_offset":32400,"time_zone":"Tokyo","geo_enabled":false,"verified":false,"statuses_count":10,"lang":"en","status":{"created_at":"Mon Jul 07 13:10:40 +0000 2014","id":486135208928751616,"id_str":"486135208928751616","text":"Wax on.","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"9AE4E8","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/21525032\/kesuke_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/21525032\/kesuke_normal.png","profile_link_color":"0000FF","profile_sidebar_border_color":"87BC44","profile_sidebar_fill_color":"E0FF92","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false} -------------------------------------------------------------------------------- /testdata/models/models_user_status.json: -------------------------------------------------------------------------------- 1 | {"name": "dick costolo", "id": 6385432, "screen_name": "dickc", "id_str": "6385432", "connections": ["blocking", "muting"]} -------------------------------------------------------------------------------- /testdata/post_blocks_create.json: -------------------------------------------------------------------------------- 1 | {"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "profile_image_url_https": "https://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "url": null, "statuses_count": 19614, "default_profile_image": false, "followers_count": 3588472, "contributors_enabled": false, "profile_sidebar_fill_color": "F3F3F3", "screen_name": "jack", "geo_enabled": true, "status": {"source": "Twitter for iPhone", "retweeted_status": {"source": "Twitter for iPhone", "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Thu May 19 18:58:09 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 26818, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733371181512990722", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733371181512990722, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [18, 41], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [], "hashtags": []}}, "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Fri May 20 14:41:34 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 0, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733668995187019777", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "RT @kanyewest: I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733668995187019777, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [33, 56], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [{"indices": [3, 13], "name": "KANYE WEST", "id": 169686021, "screen_name": "kanyewest", "id_str": "169686021"}], "hashtags": []}}, "description": "#withMalala!", "profile_background_color": "EBEBEB", "favourites_count": 12922, "verified": true, "default_profile": false, "is_translator": false, "following": false, "utc_offset": -25200, "id_str": "12", "has_extended_profile": true, "muting": false, "is_translation_enabled": false, "listed_count": 26225, "time_zone": "Pacific Time (US & Canada)", "location": "California, USA", "id": 12, "name": "Jack", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "notifications": false, "profile_sidebar_border_color": "DFDFDF", "profile_image_url": "http://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "profile_text_color": "333333", "protected": false, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "friends_count": 1969, "follow_request_sent": false, "profile_use_background_image": true, "lang": "en", "profile_link_color": "990000", "profile_background_tile": false, "entities": {"description": {"urls": []}}} -------------------------------------------------------------------------------- /testdata/post_blocks_destroy.json: -------------------------------------------------------------------------------- 1 | {"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "profile_image_url_https": "https://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "url": null, "statuses_count": 19614, "default_profile_image": false, "followers_count": 3588473, "contributors_enabled": false, "profile_sidebar_fill_color": "F3F3F3", "screen_name": "jack", "geo_enabled": true, "status": {"source": "Twitter for iPhone", "retweeted_status": {"source": "Twitter for iPhone", "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Thu May 19 18:58:09 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 26819, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733371181512990722", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733371181512990722, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [18, 41], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [], "hashtags": []}}, "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Fri May 20 14:41:34 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 0, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733668995187019777", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "RT @kanyewest: I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733668995187019777, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [33, 56], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [{"indices": [3, 13], "name": "KANYE WEST", "id": 169686021, "screen_name": "kanyewest", "id_str": "169686021"}], "hashtags": []}}, "description": "#withMalala!", "profile_background_color": "EBEBEB", "favourites_count": 12922, "verified": true, "default_profile": false, "is_translator": false, "following": false, "utc_offset": -25200, "id_str": "12", "has_extended_profile": true, "muting": false, "is_translation_enabled": false, "listed_count": 26225, "time_zone": "Pacific Time (US & Canada)", "location": "California, USA", "id": 12, "name": "Jack", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "notifications": false, "profile_sidebar_border_color": "DFDFDF", "profile_image_url": "http://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "profile_text_color": "333333", "protected": false, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "friends_count": 1969, "follow_request_sent": false, "profile_use_background_image": true, "lang": "en", "profile_link_color": "990000", "profile_background_tile": false, "entities": {"description": {"urls": []}}} -------------------------------------------------------------------------------- /testdata/post_create_list.json: -------------------------------------------------------------------------------- 1 | {"name": "test2", "user": {"profile_sidebar_border_color": "C0DEED", "profile_text_color": "333333", "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "default_profile": true, "favourites_count": 1, "time_zone": null, "created_at": "Wed Oct 21 23:53:04 +0000 2015", "url": null, "profile_background_color": "C0DEED", "profile_link_color": "0084B4", "lang": "en", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "verified": false, "profile_use_background_image": true, "utc_offset": null, "protected": true, "id": 4012966701, "id_str": "4012966701", "default_profile_image": true, "location": "", "name": "notinourselves", "geo_enabled": true, "entities": {"description": {"urls": []}}, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "statuses_count": 67, "has_extended_profile": false, "follow_request_sent": false, "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translator": false, "contributors_enabled": false, "profile_sidebar_fill_color": "DDEEF6", "notifications": false, "friends_count": 1, "screen_name": "notinourselves", "is_translation_enabled": false, "followers_count": 1, "listed_count": 1, "following": false, "description": "", "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_tile": false}, "uri": "/notinourselves/lists/test2", "id": 233452137, "created_at": "Sat Jan 30 01:08:47 +0000 2016", "description": "test for python-twitter", "slug": "test2", "mode": "private", "full_name": "@notinourselves/test2", "following": false, "member_count": 0, "id_str": "233452137", "subscriber_count": 0} -------------------------------------------------------------------------------- /testdata/post_create_lists_member.json: -------------------------------------------------------------------------------- 1 | {"member_count": 2, "created_at": "Fri Dec 18 20:00:45 +0000 2015", "subscriber_count": 0, "user": {"profile_background_tile": false, "profile_sidebar_fill_color": "DDEEF6", "default_profile_image": true, "is_translation_enabled": false, "name": "notinourselves", "has_extended_profile": false, "url": null, "friends_count": 1, "follow_request_sent": false, "profile_link_color": "0084B4", "verified": false, "profile_use_background_image": true, "profile_text_color": "333333", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "profile_background_color": "C0DEED", "followers_count": 1, "contributors_enabled": false, "profile_sidebar_border_color": "C0DEED", "notifications": false, "time_zone": null, "screen_name": "notinourselves", "location": "", "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "id": 4012966701, "listed_count": 1, "id_str": "4012966701", "geo_enabled": true, "entities": {"description": {"urls": []}}, "statuses_count": 67, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "description": "", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translator": false, "utc_offset": null, "default_profile": true, "protected": true, "favourites_count": 1, "lang": "en", "created_at": "Wed Oct 21 23:53:04 +0000 2015", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "following": false}, "id": 229581524, "id_str": "229581524", "description": "", "uri": "/notinourselves/lists/test", "full_name": "@notinourselves/test", "mode": "public", "following": true, "name": "test", "slug": "test"} -------------------------------------------------------------------------------- /testdata/post_create_lists_member_multiple.json: -------------------------------------------------------------------------------- 1 | {"member_count": 3, "created_at": "Fri Dec 18 20:00:45 +0000 2015", "subscriber_count": 0, "user": {"profile_background_tile": false, "profile_sidebar_fill_color": "DDEEF6", "default_profile_image": true, "is_translation_enabled": false, "name": "notinourselves", "has_extended_profile": false, "url": null, "friends_count": 1, "follow_request_sent": false, "profile_link_color": "0084B4", "verified": false, "profile_use_background_image": true, "profile_text_color": "333333", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "profile_background_color": "C0DEED", "followers_count": 1, "contributors_enabled": false, "profile_sidebar_border_color": "C0DEED", "notifications": false, "time_zone": null, "screen_name": "notinourselves", "location": "", "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "id": 4012966701, "listed_count": 1, "id_str": "4012966701", "geo_enabled": true, "entities": {"description": {"urls": []}}, "statuses_count": 67, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "description": "", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translator": false, "utc_offset": null, "default_profile": true, "protected": true, "favourites_count": 1, "lang": "en", "created_at": "Wed Oct 21 23:53:04 +0000 2015", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "following": false}, "id": 229581524, "id_str": "229581524", "description": "", "uri": "/notinourselves/lists/test", "full_name": "@notinourselves/test", "mode": "public", "following": true, "name": "test", "slug": "test"} -------------------------------------------------------------------------------- /testdata/post_create_subscription.json: -------------------------------------------------------------------------------- 1 | {"user": {"contributors_enabled": false, "protected": false, "profile_use_background_image": false, "profile_background_tile": false, "favourites_count": 1279, "created_at": "Sun Sep 11 23:49:28 +0000 2011", "is_translation_enabled": false, "profile_background_color": "FFFFFF", "profile_link_color": "EE3355", "listed_count": 5, "friends_count": 306, "default_profile_image": false, "screen_name": "__jcbl__", "entities": {"description": {"urls": []}, "url": {"urls": [{"expanded_url": "http://iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX", "indices": [0, 22], "display_url": "iseverythingstilltheworst.com"}]}}, "id": 372018022, "lang": "en", "location": "not a very good kingdom tbh", "statuses_count": 325, "profile_image_url_https": "https://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "default_profile": false, "time_zone": "Eastern Time (US & Canada)", "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "id_str": "372018022", "geo_enabled": false, "followers_count": 49, "has_extended_profile": false, "description": "my kingdom for a microwave that doesn't beep", "profile_sidebar_fill_color": "000000", "follow_request_sent": false, "is_translator": false, "verified": false, "name": "jeremy", "following": true, "url": "http://t.co/wtg3XzqQTX", "notifications": false, "profile_image_url": "http://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "utc_offset": -18000, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_text_color": "000000", "profile_sidebar_border_color": "000000"}, "member_count": 3, "id_str": "225486809", "slug": "my-bots", "created_at": "Tue Nov 10 16:43:07 +0000 2015", "uri": "/__jcbl__/lists/my-bots", "description": "", "full_name": "@__jcbl__/my-bots", "name": "my-bots", "following": false, "subscriber_count": 1, "mode": "public", "id": 225486809} -------------------------------------------------------------------------------- /testdata/post_destroy_direct_message.json: -------------------------------------------------------------------------------- 1 | {"id":761517675243679747,"id_str":"761517675243679747","text":"test message","sender":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":2,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":false,"statuses_count":83,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/736320724164448256\/LgaAQoav.jpg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/736320724164448256\/LgaAQoav.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/4012966701\/1453123196","profile_link_color":"000000","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"sender_id":4012966701,"sender_id_str":"4012966701","sender_screen_name":"notinourselves","recipient":{"id":372018022,"id_str":"372018022","name":"jeremy","screen_name":"__jcbl__","location":"not a very good kingdom tbh","description":"my kingdom for a microwave that doesn't beep","url":"http:\/\/t.co\/wtg3XzqQTX","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/wtg3XzqQTX","expanded_url":"http:\/\/iseverythingstilltheworst.com","display_url":"iseverythingstilltheworst.com","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":79,"friends_count":423,"listed_count":8,"created_at":"Sun Sep 11 23:49:28 +0000 2011","favourites_count":2696,"utc_offset":-14400,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":587,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"FFFFFF","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/755782670572027904\/L5YRsZAY_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/755782670572027904\/L5YRsZAY_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/372018022\/1469027675","profile_link_color":"EE3355","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":false,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":true,"follow_request_sent":false,"notifications":false},"recipient_id":372018022,"recipient_id_str":"372018022","recipient_screen_name":"__jcbl__","created_at":"Fri Aug 05 11:02:16 +0000 2016","entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]}} -------------------------------------------------------------------------------- /testdata/post_destroy_list.json: -------------------------------------------------------------------------------- 1 | {"user": {"contributors_enabled": false, "protected": true, "profile_use_background_image": true, "profile_background_tile": false, "favourites_count": 1, "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "created_at": "Wed Oct 21 23:53:04 +0000 2015", "is_translation_enabled": false, "profile_background_color": "C0DEED", "profile_link_color": "0084B4", "listed_count": 1, "friends_count": 1, "default_profile_image": true, "screen_name": "notinourselves", "entities": {"description": {"urls": []}}, "id": 4012966701, "lang": "en", "location": "", "statuses_count": 67, "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "default_profile": true, "time_zone": null, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "id_str": "4012966701", "geo_enabled": true, "followers_count": 1, "has_extended_profile": false, "description": "", "profile_sidebar_fill_color": "DDEEF6", "follow_request_sent": false, "is_translator": false, "verified": false, "name": "notinourselves", "following": false, "url": null, "notifications": false, "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "utc_offset": null, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_text_color": "333333", "profile_sidebar_border_color": "C0DEED"}, "member_count": 0, "id_str": "233452137", "slug": "test2", "created_at": "Sat Jan 30 01:08:47 +0000 2016", "uri": "/notinourselves/lists/test2", "description": "test for python-twitter", "full_name": "@notinourselves/test2", "name": "test2", "following": true, "subscriber_count": 0, "mode": "private", "id": 233452137} -------------------------------------------------------------------------------- /testdata/post_destroy_lists_member.json: -------------------------------------------------------------------------------- 1 | {"member_count": 1, "created_at": "Fri Dec 18 20:00:45 +0000 2015", "subscriber_count": 0, "user": {"profile_background_tile": false, "profile_sidebar_fill_color": "DDEEF6", "default_profile_image": true, "is_translation_enabled": false, "name": "notinourselves", "has_extended_profile": false, "url": null, "friends_count": 1, "follow_request_sent": false, "profile_link_color": "0084B4", "verified": false, "profile_use_background_image": true, "profile_text_color": "333333", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "profile_background_color": "C0DEED", "followers_count": 1, "contributors_enabled": false, "profile_sidebar_border_color": "C0DEED", "notifications": false, "time_zone": null, "screen_name": "notinourselves", "location": "", "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "id": 4012966701, "listed_count": 1, "id_str": "4012966701", "geo_enabled": true, "entities": {"description": {"urls": []}}, "statuses_count": 67, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "description": "", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translator": false, "utc_offset": null, "default_profile": true, "protected": true, "favourites_count": 1, "lang": "en", "created_at": "Wed Oct 21 23:53:04 +0000 2015", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "following": false}, "id": 229581524, "id_str": "229581524", "description": "", "uri": "/notinourselves/lists/test", "full_name": "@notinourselves/test", "mode": "public", "following": true, "name": "test", "slug": "test"} -------------------------------------------------------------------------------- /testdata/post_destroy_lists_member_multiple.json: -------------------------------------------------------------------------------- 1 | {"member_count": 0, "created_at": "Fri Dec 18 20:00:45 +0000 2015", "subscriber_count": 0, "user": {"profile_background_tile": false, "profile_sidebar_fill_color": "DDEEF6", "default_profile_image": true, "is_translation_enabled": false, "name": "notinourselves", "has_extended_profile": false, "url": null, "friends_count": 1, "follow_request_sent": false, "profile_link_color": "0084B4", "verified": false, "profile_use_background_image": true, "profile_text_color": "333333", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "profile_background_color": "C0DEED", "followers_count": 1, "contributors_enabled": false, "profile_sidebar_border_color": "C0DEED", "notifications": false, "time_zone": null, "screen_name": "notinourselves", "location": "", "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "id": 4012966701, "listed_count": 1, "id_str": "4012966701", "geo_enabled": true, "entities": {"description": {"urls": []}}, "statuses_count": 67, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "description": "", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translator": false, "utc_offset": null, "default_profile": true, "protected": true, "favourites_count": 1, "lang": "en", "created_at": "Wed Oct 21 23:53:04 +0000 2015", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "following": false}, "id": 229581524, "id_str": "229581524", "description": "", "uri": "/notinourselves/lists/test", "full_name": "@notinourselves/test", "mode": "public", "following": true, "name": "test", "slug": "test"} -------------------------------------------------------------------------------- /testdata/post_destroy_status.json: -------------------------------------------------------------------------------- 1 | {"created_at":"Sat Jun 25 00:58:31 +0000 2016","id":746507834003578880,"id_str":"746507834003578880","text":"lord let this work","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"source":"\u003ca href=\"http:\/\/iseverythingstilltheworst.com\" rel=\"nofollow\"\u003egbtest--notinourselves\u003c\/a\u003e","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":2,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":false,"statuses_count":84,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/736320724164448256\/LgaAQoav.jpg","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/736320724164448256\/LgaAQoav.jpg","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/4012966701\/1453123196","profile_link_color":"000000","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":1,"favorited":false,"retweeted":false,"lang":"en"} -------------------------------------------------------------------------------- /testdata/post_destroy_subscription.json: -------------------------------------------------------------------------------- 1 | {"user": {"contributors_enabled": false, "protected": false, "profile_use_background_image": false, "profile_background_tile": false, "favourites_count": 1279, "created_at": "Sun Sep 11 23:49:28 +0000 2011", "is_translation_enabled": false, "profile_background_color": "FFFFFF", "profile_link_color": "EE3355", "listed_count": 5, "friends_count": 306, "default_profile_image": false, "screen_name": "__jcbl__", "entities": {"description": {"urls": []}, "url": {"urls": [{"expanded_url": "http://iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX", "indices": [0, 22], "display_url": "iseverythingstilltheworst.com"}]}}, "id": 372018022, "lang": "en", "location": "not a very good kingdom tbh", "statuses_count": 325, "profile_image_url_https": "https://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "default_profile": false, "time_zone": "Eastern Time (US & Canada)", "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "id_str": "372018022", "geo_enabled": false, "followers_count": 49, "has_extended_profile": false, "description": "my kingdom for a microwave that doesn't beep", "profile_sidebar_fill_color": "000000", "follow_request_sent": false, "is_translator": false, "verified": false, "name": "jeremy", "following": true, "url": "http://t.co/wtg3XzqQTX", "notifications": false, "profile_image_url": "http://pbs.twimg.com/profile_images/659691753826615298/yN1SoWrU_normal.jpg", "utc_offset": -18000, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_text_color": "000000", "profile_sidebar_border_color": "000000"}, "member_count": 3, "id_str": "225486809", "slug": "my-bots", "created_at": "Tue Nov 10 16:43:07 +0000 2015", "uri": "/__jcbl__/lists/my-bots", "description": "", "full_name": "@__jcbl__/my-bots", "name": "my-bots", "following": true, "subscriber_count": 0, "mode": "public", "id": 225486809} -------------------------------------------------------------------------------- /testdata/post_media.json: -------------------------------------------------------------------------------- 1 | {"media_id":681607069120737280,"media_id_string":"681607069120737280","size":3058,"expires_after_secs":86400,"image":{"image_type":"image\\/jpeg","w":100,"h":100}} -------------------------------------------------------------------------------- /testdata/post_mutes_users_create.json: -------------------------------------------------------------------------------- 1 | {"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "profile_image_url_https": "https://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "url": null, "statuses_count": 19614, "default_profile_image": false, "followers_count": 3588497, "contributors_enabled": false, "profile_sidebar_fill_color": "F3F3F3", "screen_name": "jack", "geo_enabled": true, "status": {"source": "Twitter for iPhone", "retweeted_status": {"source": "Twitter for iPhone", "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Thu May 19 18:58:09 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 26821, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733371181512990722", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733371181512990722, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [18, 41], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [], "hashtags": []}}, "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Fri May 20 14:41:34 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 0, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733668995187019777", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "RT @kanyewest: I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733668995187019777, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [33, 56], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [{"indices": [3, 13], "name": "KANYE WEST", "id": 169686021, "screen_name": "kanyewest", "id_str": "169686021"}], "hashtags": []}}, "description": "#withMalala!", "profile_background_color": "EBEBEB", "favourites_count": 12922, "verified": true, "default_profile": false, "is_translator": false, "following": false, "utc_offset": -25200, "id_str": "12", "has_extended_profile": true, "muting": false, "is_translation_enabled": false, "listed_count": 26225, "time_zone": "Pacific Time (US & Canada)", "location": "California, USA", "id": 12, "name": "Jack", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "notifications": false, "profile_sidebar_border_color": "DFDFDF", "profile_image_url": "http://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "profile_text_color": "333333", "protected": false, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "friends_count": 1969, "follow_request_sent": false, "profile_use_background_image": true, "lang": "en", "profile_link_color": "990000", "profile_background_tile": false, "entities": {"description": {"urls": []}}} -------------------------------------------------------------------------------- /testdata/post_mutes_users_create_skip_status.json: -------------------------------------------------------------------------------- 1 | {"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "profile_image_url_https": "https://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "url": null, "statuses_count": 19614, "default_profile_image": false, "followers_count": 3588498, "contributors_enabled": false, "profile_sidebar_fill_color": "F3F3F3", "screen_name": "jack", "geo_enabled": true, "profile_text_color": "333333", "description": "#withMalala!", "profile_background_color": "EBEBEB", "favourites_count": 12922, "verified": true, "default_profile": false, "is_translator": false, "following": false, "utc_offset": -25200, "id_str": "12", "has_extended_profile": true, "muting": false, "is_translation_enabled": false, "listed_count": 26225, "time_zone": "Pacific Time (US & Canada)", "location": "California, USA", "id": 12, "name": "Jack", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "notifications": false, "profile_sidebar_border_color": "DFDFDF", "profile_image_url": "http://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "protected": false, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "friends_count": 1969, "follow_request_sent": false, "profile_use_background_image": true, "lang": "en", "profile_link_color": "990000", "profile_background_tile": false, "entities": {"description": {"urls": []}}} -------------------------------------------------------------------------------- /testdata/post_mutes_users_destroy.json: -------------------------------------------------------------------------------- 1 | {"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme7/bg.gif", "profile_image_url_https": "https://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "url": null, "statuses_count": 19614, "default_profile_image": false, "followers_count": 3588498, "contributors_enabled": false, "profile_sidebar_fill_color": "F3F3F3", "screen_name": "jack", "geo_enabled": true, "status": {"source": "Twitter for iPhone", "retweeted_status": {"source": "Twitter for iPhone", "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Thu May 19 18:58:09 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 26821, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733371181512990722", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733371181512990722, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [18, 41], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [], "hashtags": []}}, "coordinates": null, "geo": null, "retweet_count": 10929, "created_at": "Fri May 20 14:41:34 +0000 2016", "in_reply_to_status_id_str": null, "in_reply_to_screen_name": null, "place": null, "favorite_count": 0, "in_reply_to_user_id_str": null, "is_quote_status": false, "id_str": "733668995187019777", "in_reply_to_status_id": null, "lang": "en", "favorited": false, "text": "RT @kanyewest: I love you Ellen https://t.co/B7Ulmf8E01", "truncated": false, "in_reply_to_user_id": null, "contributors": null, "retweeted": false, "id": 733668995187019777, "possibly_sensitive": false, "entities": {"symbols": [], "urls": [{"indices": [33, 56], "expanded_url": "http://www.ellentv.com/videos/0-u3mktrdh/", "display_url": "ellentv.com/videos/0-u3mkt\u2026", "url": "https://t.co/B7Ulmf8E01"}], "user_mentions": [{"indices": [3, 13], "name": "KANYE WEST", "id": 169686021, "screen_name": "kanyewest", "id_str": "169686021"}], "hashtags": []}}, "description": "#withMalala!", "profile_background_color": "EBEBEB", "favourites_count": 12922, "verified": true, "default_profile": false, "is_translator": false, "following": false, "utc_offset": -25200, "id_str": "12", "has_extended_profile": true, "muting": true, "is_translation_enabled": false, "listed_count": 26225, "time_zone": "Pacific Time (US & Canada)", "location": "California, USA", "id": 12, "name": "Jack", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme7/bg.gif", "notifications": false, "profile_sidebar_border_color": "DFDFDF", "profile_image_url": "http://pbs.twimg.com/profile_images/668328458519384064/FSAIjKRl_normal.jpg", "profile_text_color": "333333", "protected": false, "created_at": "Tue Mar 21 20:50:14 +0000 2006", "friends_count": 1969, "follow_request_sent": false, "profile_use_background_image": true, "lang": "en", "profile_link_color": "990000", "profile_background_tile": false, "entities": {"description": {"urls": []}}} -------------------------------------------------------------------------------- /testdata/post_post_direct_message.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": { 3 | "created_timestamp": "1534347829024", 4 | "message_create": { 5 | "message_data": { 6 | "text": "test message", 7 | "entities": { 8 | "symbols": [], 9 | "user_mentions": [], 10 | "hashtags": [], 11 | "urls": [] 12 | } 13 | }, 14 | "sender_id": "4012966701", 15 | "target": { 16 | "recipient_id": "372018022" 17 | } 18 | }, 19 | "type": "message_create", 20 | "id": "761517675243679747" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /testdata/post_update.json: -------------------------------------------------------------------------------- 1 | {"created_at":"Mon Dec 28 15:25:56 +0000 2015","id":681496308251754496,"id_str":"681496308251754496","text":"blah Longitude coordinate of the tweet in degrees.","source":"\u003ca href=\"http:\/\/iseverythingstilltheworst.com\" rel=\"nofollow\"\u003egbtest--notinourselves\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":1,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":29,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"} -------------------------------------------------------------------------------- /testdata/post_update_extra_params.json: -------------------------------------------------------------------------------- 1 | {"created_at":"Mon Dec 28 16:51:40 +0000 2015","id":681517887102808064,"id_str":"681517887102808064","text":"Not a dupe. Longitude coordinate of the tweet in degrees.","source":"\u003ca href=\"http:\/\/iseverythingstilltheworst.com\" rel=\"nofollow\"\u003egbtest--notinourselves\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":681496308251754496,"in_reply_to_status_id_str":"681496308251754496","in_reply_to_user_id":4012966701,"in_reply_to_user_id_str":"4012966701","in_reply_to_screen_name":"notinourselves","user":{"id":4012966701,"id_str":"4012966701"},"geo":{"type":"Point","coordinates":[37.781157,-122.398720]},"coordinates":{"type":"Point","coordinates":[-122.398720,37.781157]},"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"} -------------------------------------------------------------------------------- /testdata/post_update_media_id.json: -------------------------------------------------------------------------------- 1 | {"favorited": false, "in_reply_to_user_id_str": null, "in_reply_to_user_id": null, "in_reply_to_status_id": null, "is_quote_status": false, "ext": {"stickerInfo": {"r": {"err": {"code": 402, "message": "ColumnNotFound"}}, "ttl": -1}}, "in_reply_to_screen_name": null, "truncated": false, "id": 697007422867664896, "entities": {"symbols": [], "user_mentions": [], "media": [{"expanded_url": "http://twitter.com/notinourselves/status/697007422867664896/photo/1", "display_url": "pic.twitter.com/FHgqb6iLOX", "id": 697007311538229248, "indices": [50, 73], "type": "photo", "media_url": "http://pbs.twimg.com/media/CaxEdPoWEAAgCAh.jpg", "url": "https://t.co/FHgqb6iLOX", "id_str": "697007311538229248", "media_url_https": "https://pbs.twimg.com/media/CaxEdPoWEAAgCAh.jpg", "sizes": {"large": {"resize": "fit", "w": 500, "h": 500}, "thumb": {"resize": "crop", "w": 150, "h": 150}, "medium": {"resize": "fit", "w": 500, "h": 500}, "small": {"resize": "fit", "w": 340, "h": 340}}}], "hashtags": [], "urls": []}, "retweeted": false, "lang": "en", "geo": null, "source": "gbtest--notinourselves", "coordinates": null, "user": {"default_profile_image": true, "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "protected": true, "id_str": "4012966701", "follow_request_sent": false, "location": "", "profile_background_color": "C0DEED", "profile_banner_url": "https://pbs.twimg.com/profile_banners/4012966701/1453123196", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png", "is_translation_enabled": false, "friends_count": 1, "id": 4012966701, "time_zone": null, "entities": {"description": {"urls": []}}, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "screen_name": "notinourselves", "lang": "en", "profile_link_color": "0084B4", "verified": false, "notifications": false, "favourites_count": 1, "utc_offset": null, "statuses_count": 68, "profile_sidebar_border_color": "C0DEED", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "has_extended_profile": false, "is_translator": false, "description": "", "name": "notinourselves", "default_profile": true, "profile_use_background_image": true, "following": false, "geo_enabled": true, "listed_count": 1, "url": null, "contributors_enabled": false, "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_background_tile": false, "created_at": "Wed Oct 21 23:53:04 +0000 2015", "followers_count": 1}, "place": null, "text": "hi this is a test for media uploads with statuses https://t.co/FHgqb6iLOX", "favorite_count": 0, "in_reply_to_status_id_str": null, "retweet_count": 0, "extended_entities": {"media": [{"expanded_url": "http://twitter.com/notinourselves/status/697007422867664896/photo/1", "display_url": "pic.twitter.com/FHgqb6iLOX", "id": 697007311538229248, "indices": [50, 73], "type": "photo", "media_url": "http://pbs.twimg.com/media/CaxEdPoWEAAgCAh.jpg", "url": "https://t.co/FHgqb6iLOX", "id_str": "697007311538229248", "media_url_https": "https://pbs.twimg.com/media/CaxEdPoWEAAgCAh.jpg", "sizes": {"large": {"resize": "fit", "w": 500, "h": 500}, "thumb": {"resize": "crop", "w": 150, "h": 150}, "medium": {"resize": "fit", "w": 500, "h": 500}, "small": {"resize": "fit", "w": 340, "h": 340}}}]}, "id_str": "697007422867664896", "contributors": null, "possibly_sensitive": false, "created_at": "Tue Feb 09 10:41:34 +0000 2016"} -------------------------------------------------------------------------------- /testdata/post_update_with_media.json: -------------------------------------------------------------------------------- 1 | {"created_at":"Mon Dec 28 17:04:56 +0000 2015","id":681521223797452801,"id_str":"681521223797452801","text":"Media test for PostUpdate.","source":"\u003ca href=\"http:\/\/iseverythingstilltheworst.com\" rel=\"nofollow\"\u003egbtest--notinourselves\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":1,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":false,"statuses_count":35,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"} -------------------------------------------------------------------------------- /testdata/post_update_with_place.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Sun Oct 14 20:44:37 +0000 2018", 3 | "hashtags": [], 4 | "id": 1051574521818435584, 5 | "id_str": "1051574521818435584", 6 | "lang": "en", 7 | "place": { 8 | "bounding_box": { 9 | "coordinates": [ 10 | [ 11 | [ 12 | -105.14544044849526, 13 | 40.19213775503984 14 | ], 15 | [ 16 | -105.14544044849526, 17 | 40.19213775503984 18 | ], 19 | [ 20 | -105.14544044849526, 21 | 40.19213775503984 22 | ], 23 | [ 24 | -105.14544044849526, 25 | 40.19213775503984 26 | ] 27 | ] 28 | ], 29 | "type": "Polygon" 30 | }, 31 | "full_name": "McIntosh Lake", 32 | "id": "07d9db48bc083000", 33 | "name": "McIntosh Lake", 34 | "place_type": "poi", 35 | "url": "https://api.twitter.com/1.1/geo/id/07d9db48bc083000.json" 36 | }, 37 | "urls": [], 38 | "user": { 39 | "created_at": "Sat May 26 17:34:57 +0000 2018", 40 | "default_profile": true, 41 | "default_profile_image": true, 42 | "geo_enabled": true, 43 | "id": 1000430098892378113, 44 | "id_str": "1000430098892378113", 45 | "lang": "en", 46 | "name": "DECKSET", 47 | "profile_background_color": "F5F8FA", 48 | "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png", 49 | "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png", 50 | "profile_link_color": "1DA1F2", 51 | "profile_sidebar_border_color": "C0DEED", 52 | "profile_sidebar_fill_color": "DDEEF6", 53 | "profile_text_color": "333333", 54 | "profile_use_background_image": true, 55 | "screen_name": "DECKSET1", 56 | "statuses_count": 1 57 | }, 58 | "user_mentions": [] 59 | } -------------------------------------------------------------------------------- /testdata/post_upload_chunked_FINAL.json: -------------------------------------------------------------------------------- 1 | {"image": {"image_type": "image/gif", "h": 270, "w": 500}, "media_id_string": "737956420046356480", "media_id": 737956420046356480, "expires_after_secs": 86400, "size": 2158019} -------------------------------------------------------------------------------- /testdata/post_upload_chunked_INIT.json: -------------------------------------------------------------------------------- 1 | {"media_id_string": "737956420046356480", "media_id": 737956420046356480, "expires_after_secs": 86400} -------------------------------------------------------------------------------- /testdata/post_upload_media_simple.json: -------------------------------------------------------------------------------- 1 | {"image": {"w": 500, "h": 500, "image_type": "image/jpeg"}, "media_id_string": "697007311538229248", "media_id": 697007311538229248, "size": 44772, "expires_after_secs": 86400} -------------------------------------------------------------------------------- /testdata/public_timeline_error.json: -------------------------------------------------------------------------------- 1 | {"error": "test error"} 2 | -------------------------------------------------------------------------------- /testdata/retweet.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Sun Jun 03 18:15:29 +0000 2007", 3 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 4 | "id": 89512102, 5 | "user": { 6 | "name": "Kesuke Miyagi", 7 | "description": "\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002", 8 | "location": "Okinawa, Japan", 9 | "profile_image_url": "http://assets1.twitter.com/system/user/profile_image/718443/normal/kesuke.png?1169966399", 10 | "url": null, 11 | "id": 718443, 12 | "screen_name": "kesuke", 13 | "protected": false 14 | } 15 | } -------------------------------------------------------------------------------- /testdata/retweets_of_me.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id_str": "253650670274637824", 4 | "user": { 5 | "id_str": "14364433", 6 | "id": 14364433 7 | }, 8 | "place": null, 9 | "favorited": false, 10 | "created_at": "Thu Oct 04 00:20:07 +0000 2012", 11 | "coordinates": null, 12 | "contributors": null, 13 | "retweet_count": 1, 14 | "in_reply_to_status_id_str": null, 15 | "in_reply_to_user_id_str": null, 16 | "retweeted": false, 17 | "in_reply_to_screen_name": null, 18 | "text": "Can we be done with phone books already?", 19 | "truncated": false, 20 | "source": "foo", 21 | "in_reply_to_user_id": null, 22 | "in_reply_to_status_id": null, 23 | "id": 253650670274637824, 24 | "geo": null 25 | } 26 | ] -------------------------------------------------------------------------------- /testdata/show-89512102.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Sun Jun 03 18:15:29 +0000 2007", 3 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 4 | "id": 89512102, 5 | "user": { 6 | "name": "Kesuke Miyagi", 7 | "description": "\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002", 8 | "location": "Okinawa, Japan", 9 | "profile_image_url": "http://assets1.twitter.com/system/user/profile_image/718443/normal/kesuke.png?1169966399", 10 | "url": null, 11 | "id": 718443, 12 | "screen_name": "kesuke", 13 | "protected": false 14 | } 15 | } -------------------------------------------------------------------------------- /testdata/show-dewitt.json: -------------------------------------------------------------------------------- 1 | { 2 | "friends_count": 40, 3 | "profile_background_color": "FFFFFF", 4 | "name": "DeWitt", 5 | "statuses_count": 71, 6 | "followers_count": 64, 7 | "profile_text_color": "121212", 8 | "favourites_count": 2, 9 | "profile_link_color": "666666", 10 | "description": "Indeterminate things", 11 | "location": "San Francisco, CA", 12 | "profile_sidebar_fill_color": "CCCCCC", 13 | "url": "http://unto.net/", 14 | "id": 673483, 15 | "profile_sidebar_border_color": "333333", 16 | "protected": false, 17 | "status": { 18 | "created_at": "Sun Jun 03 19:50:23 +0000 2007", 19 | "text": "If a theme song played when I walked around all day, I'd want it to be All My Friends by LCD Soundsystem.", 20 | "id": 89586072 21 | }, 22 | "profile_image_url": "http://assets0.twitter.com/system/user/profile_image/673483/normal/me.jpg?1171965914", 23 | "screen_name": "dewitt" 24 | } -------------------------------------------------------------------------------- /testdata/status-destroy.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Wed Jun 13 17:08:02 +0000 2007", 3 | "text": "Just a final test before 0.4 release!", 4 | "id": 103208352, 5 | "user": { 6 | "name": "Kesuke Miyagi", 7 | "description": "\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002", 8 | "location": "Okinawa, Japan", 9 | "profile_image_url": "http://assets1.twitter.com/system/user/profile_image/718443/normal/kesuke.png?1169966399", 10 | "url": null, 11 | "id": 718443, 12 | "screen_name": "kesuke", 13 | "protected": false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testdata/streaming/streaming_extended_tweet.json: -------------------------------------------------------------------------------- 1 | {"contributors": null, "place": null, "coordinates": null, "source": "Doesnothaveanameyet", "possibly_sensitive": false, "id": 971726741583605760, "text": "HIV_AIDS_BiojQuery Mobile Web Development Essentials, Second Edition: https://t.co/r78h6xfAby Quantum AI Big/Small/\u2026 https://t.co/ZPJrpMvcZG", "favorite_count": 0, "reply_count": 0, "is_quote_status": false, "in_reply_to_status_id_str": null, "filter_level": "low", "favorited": false, "retweeted": false, "created_at": "Thu Mar 08 12:38:03 +0000 2018", "id_str": "971726741583605760", "entities": {"user_mentions": [], "urls": [{"expanded_url": "http://www.amazon.com/gp/product/1782167897/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1782167897&linkCode=as2&tag=hardwaresoftw-20", "url": "https://t.co/r78h6xfAby", "indices": [70, 93], "display_url": "amazon.com/gp/product/178\u2026"}, {"expanded_url": "https://twitter.com/i/web/status/971726741583605760", "url": "https://t.co/ZPJrpMvcZG", "indices": [117, 140], "display_url": "twitter.com/i/web/status/9\u2026"}], "symbols": [], "hashtags": []}, "extended_tweet": {"entities": {"user_mentions": [], "urls": [{"expanded_url": "http://www.amazon.com/gp/product/1782167897/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1782167897&linkCode=as2&tag=hardwaresoftw-20", "url": "https://t.co/r78h6xfAby", "indices": [70, 93], "display_url": "amazon.com/gp/product/178\u2026"}, {"expanded_url": "http://hwswworld.com/index.php?route=product/category&path=13", "url": "https://t.co/cnCBNJvu6T", "indices": [184, 207], "display_url": "hwswworld.com/index.php?rout\u2026"}], "symbols": [], "hashtags": []}, "full_text": "HIV_AIDS_BiojQuery Mobile Web Development Essentials, Second Edition: https://t.co/r78h6xfAby Quantum AI Big/Small/0 Data Cloud/Fog Computing OutLook from ClouData & Multiverse - https://t.co/cnCBNJvu6T", "display_text_range": [0, 207]}, "retweet_count": 0, "user": {"following": null, "time_zone": "Arizona", "statuses_count": 3208936, "profile_background_color": "000000", "location": "San Francisco, CA", "profile_use_background_image": false, "listed_count": 622, "profile_sidebar_border_color": "000000", "url": "https://www.hwswworld.com/index.php?route=product/category&path=139", "protected": false, "contributors_enabled": false, "translator_type": "none", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "id": 2319610428, "is_translator": false, "name": "AIBigDataCloudIoTBot", "geo_enabled": false, "screen_name": "ClouDatAI", "notifications": null, "profile_banner_url": "https://pbs.twimg.com/profile_banners/2319610428/1494029092", "profile_link_color": "9266CC", "follow_request_sent": null, "description": "Global Weekly PB-Scale 40-Node 2TB AI Deep Learning Big Data Cloud Boot Camp - We Fly to Your City in Serving You Once You Make an Order - train@hwswworld.com", "id_str": "2319610428", "followers_count": 1830, "lang": "en", "created_at": "Thu Jan 30 21:58:33 +0000 2014", "profile_background_tile": false, "friends_count": 0, "verified": false, "profile_sidebar_fill_color": "000000", "favourites_count": 0, "utc_offset": -25200, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "default_profile": false, "profile_image_url_https": "https://pbs.twimg.com/profile_images/853471626792378368/rVamVryI_normal.jpg", "profile_text_color": "000000", "default_profile_image": false, "profile_image_url": "http://pbs.twimg.com/profile_images/853471626792378368/rVamVryI_normal.jpg"}, "in_reply_to_status_id": null, "geo": null, "truncated": true, "in_reply_to_user_id_str": null, "in_reply_to_screen_name": null, "quote_count": 0, "timestamp_ms": "1520512683660", "lang": "en", "in_reply_to_user_id": null} -------------------------------------------------------------------------------- /testdata/subs.srt: -------------------------------------------------------------------------------- 1 | 1 2 | 00:00:00,000 --> 00:00:03,251 3 | Lorem ipsum dolor sit amet, 4 | consectetur adipiscing elit. 5 | 6 | 2 7 | 00:00:03,251 --> 00:00:06,502 8 | Maecenas rutrum suscipit accumsan. 9 | -------------------------------------------------------------------------------- /testdata/update.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Sun Jun 03 18:15:29 +0000 2007", 3 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 4 | "id": 89512102, 5 | "user": { 6 | "name": "Kesuke Miyagi", 7 | "description": "\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002", 8 | "location": "Okinawa, Japan", 9 | "profile_image_url": "http://assets1.twitter.com/system/user/profile_image/718443/normal/kesuke.png?1169966399", 10 | "url": null, 11 | "id": 718443, 12 | "screen_name": "kesuke", 13 | "protected": false 14 | } 15 | } -------------------------------------------------------------------------------- /testdata/update_friendship.json: -------------------------------------------------------------------------------- 1 | {"relationship":{"source":{"id":372018022,"id_str":"372018022","screen_name":"__jcbl__","following":true,"followed_by":false,"live_following":false,"following_received":null,"following_requested":false,"notifications_enabled":false,"can_dm":false,"blocking":false,"blocked_by":false,"muting":false,"want_retweets":true,"all_replies":false,"marked_spam":false},"target":{"id":2425151,"id_str":"2425151","screen_name":"facebook","following":false,"followed_by":true,"following_received":false,"following_requested":null}}} -------------------------------------------------------------------------------- /testdata/update_latlong.json: -------------------------------------------------------------------------------- 1 | { 2 | "created_at": "Sun Jun 03 18:15:29 +0000 2007", 3 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 4 | "id": 89512102, 5 | "geo": { 6 | "type": "Point", 7 | "coordinates": [ 8 | 26.2, 9 | 127.5 10 | ] 11 | }, 12 | "coordinates": { 13 | "type": "Point", 14 | "coordinates": [ 15 | 127.5, 16 | 26.2 17 | ] 18 | }, 19 | "user": { 20 | "name": "Kesuke Miyagi", 21 | "description": "\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002", 22 | "location": "Okinawa, Japan", 23 | "profile_image_url": "http://assets1.twitter.com/system/user/profile_image/718443/normal/kesuke.png?1169966399", 24 | "url": null, 25 | "id": 718443, 26 | "screen_name": "kesuke", 27 | "protected": false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /testdata/update_profile.json: -------------------------------------------------------------------------------- 1 | {"follow_request_sent": null, "profile_image_url_https": "https://pbs.twimg.com/profile_images/968861535127949312/v7ZnBn4I_normal.jpg", "location": "philly", "created_at": "Sun Sep 11 23:49:28 +0000 2011", "profile_banner_url": "https://pbs.twimg.com/profile_banners/372018022/1475799101", "has_extended_profile": false, "is_translation_enabled": false, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "description": "these people have addresses | #botally", "statuses_count": 4083, "profile_sidebar_fill_color": "000000", "following": null, "profile_location": null, "lang": "en", "default_profile_image": false, "verified": false, "notifications": null, "profile_image_url": "http://pbs.twimg.com/profile_images/968861535127949312/v7ZnBn4I_normal.jpg", "geo_enabled": false, "favourites_count": 20700, "profile_link_color": "EE3355", "utc_offset": -18000, "protected": true, "profile_sidebar_border_color": "000000", "friends_count": 497, "screen_name": "__jcbl__", "profile_background_color": "FFFFFF", "url": "https://t.co/wtg3XyA3vL", "id": 372018022, "entities": {"description": {"urls": []}, "url": {"urls": [{"display_url": "iseverythingstilltheworst.com", "expanded_url": "http://iseverythingstilltheworst.com", "url": "https://t.co/wtg3XyA3vL", "indices": [0, 23]}]}}, "followers_count": 189, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "profile_use_background_image": false, "contributors_enabled": false, "translator_type": "none", "default_profile": false, "profile_background_tile": false, "name": "jeremy", "id_str": "372018022", "listed_count": 6, "profile_text_color": "000000", "is_translator": false, "time_zone": "Eastern Time (US & Canada)"} -------------------------------------------------------------------------------- /testdata/user_timeline-kesuke.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "created_at": "Sun Jun 03 18:15:29 +0000 2007", 4 | "text": "\u041c\u043e\u0451 \u0441\u0443\u0434\u043d\u043e \u043d\u0430 \u0432\u043e\u0437\u0434\u0443\u0448\u043d\u043e\u0439 \u043f\u043e\u0434\u0443\u0448\u043a\u0435 \u043f\u043e\u043b\u043d\u043e \u0443\u0433\u0440\u0435\u0439", 5 | "id": 89512102, 6 | "user": { 7 | "name": "Kesuke Miyagi", 8 | "description": "\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002", 9 | "location": "Okinawa, Japan", 10 | "url": null, 11 | "id": 718443, 12 | "protected": false, 13 | "profile_image_url": "http://assets1.twitter.com/system/user/profile_image/718443/normal/kesuke.png?1169966399", 14 | "screen_name": "kesuke" 15 | } 16 | } 17 | ] -------------------------------------------------------------------------------- /testdata/user_timeline.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "user": { 4 | "name": "DeWitt", 5 | "url": "http://unto.net/", 6 | "id": 673483, 7 | "description": "Indeterminate things", 8 | "screen_name": "dewitt", 9 | "location": "San Francisco, CA" 10 | }, 11 | "text": "\"Select all\" and archive your Gmail inbox. The page loads so much faster!", 12 | "id": 4212713, 13 | "relative_created_at": "2 days ago", 14 | "created_at": "Fri Jan 26 17:28:19 +0000 2007" 15 | } 16 | ] -------------------------------------------------------------------------------- /testdata/users_lookup.json: -------------------------------------------------------------------------------- 1 | [{"id":718443,"id_str":"718443","name":"Kesuke Miyagi","screen_name":"kesuke","location":"Okinawa, Japan","description":"\u79c1\u306e\u30db\u30d0\u30fc\u30af\u30e9\u30d5\u30c8 \u306f\u9c3b\u304c\u4e00\u676f\u3067\u3059\u3002","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":22,"friends_count":1,"listed_count":6,"created_at":"Sun Jan 28 06:31:55 +0000 2007","favourites_count":0,"utc_offset":32400,"time_zone":"Tokyo","geo_enabled":false,"verified":false,"statuses_count":10,"lang":"en","status":{"created_at":"Mon Jul 07 13:10:40 +0000 2014","id":486135208928751616,"id_str":"486135208928751616","text":"Wax on.","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[]},"favorited":false,"retweeted":false,"lang":"en"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"9AE4E8","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/21525032\/kesuke_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/21525032\/kesuke_normal.png","profile_link_color":"0000FF","profile_sidebar_border_color":"87BC44","profile_sidebar_fill_color":"E0FF92","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":false,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false}] -------------------------------------------------------------------------------- /testdata/verify_credentials.json: -------------------------------------------------------------------------------- 1 | {"id":4012966701,"id_str":"4012966701","name":"notinourselves","screen_name":"notinourselves","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":true,"followers_count":1,"friends_count":1,"listed_count":1,"created_at":"Wed Oct 21 23:53:04 +0000 2015","favourites_count":1,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":false,"statuses_count":67,"lang":"en","status":{"created_at":"Sat Jan 16 21:34:06 +0000 2016","id":688474332406923265,"id_str":"688474332406923265","text":"totally nutz https:\/\/t.co\/cyrpU6X2k3","source":"\u003ca href=\"http:\/\/iseverythingstilltheworst.com\" rel=\"nofollow\"\u003egbtest--notinourselves\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[],"media":[{"id":688474330007732224,"id_str":"688474330007732224","indices":[13,36],"media_url":"http:\/\/pbs.twimg.com\/media\/CY3zwWUWAAA5AIa.jpg","media_url_https":"https:\/\/pbs.twimg.com\/media\/CY3zwWUWAAA5AIa.jpg","url":"https:\/\/t.co\/cyrpU6X2k3","display_url":"pic.twitter.com\/cyrpU6X2k3","expanded_url":"http:\/\/twitter.com\/notinourselves\/status\/688474332406923265\/photo\/1","type":"photo","sizes":{"medium":{"w":600,"h":383,"resize":"fit"},"small":{"w":340,"h":217,"resize":"fit"},"large":{"w":1008,"h":645,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"}}}]},"extended_entities":{"media":[{"id":688474330007732224,"id_str":"688474330007732224","indices":[13,36],"media_url":"http:\/\/pbs.twimg.com\/media\/CY3zwWUWAAA5AIa.jpg","media_url_https":"https:\/\/pbs.twimg.com\/media\/CY3zwWUWAAA5AIa.jpg","url":"https:\/\/t.co\/cyrpU6X2k3","display_url":"pic.twitter.com\/cyrpU6X2k3","expanded_url":"http:\/\/twitter.com\/notinourselves\/status\/688474332406923265\/photo\/1","type":"photo","sizes":{"medium":{"w":600,"h":383,"resize":"fit"},"small":{"w":340,"h":217,"resize":"fit"},"large":{"w":1008,"h":645,"resize":"fit"},"thumb":{"w":150,"h":150,"resize":"crop"}}},{"id":688474331245088773,"id_str":"688474331245088773","indices":[13,36],"media_url":"http:\/\/pbs.twimg.com\/media\/CY3zwa7WkAUJ39K.jpg","media_url_https":"https:\/\/pbs.twimg.com\/media\/CY3zwa7WkAUJ39K.jpg","url":"https:\/\/t.co\/cyrpU6X2k3","display_url":"pic.twitter.com\/cyrpU6X2k3","expanded_url":"http:\/\/twitter.com\/notinourselves\/status\/688474332406923265\/photo\/1","type":"photo","sizes":{"medium":{"w":100,"h":100,"resize":"fit"},"thumb":{"w":100,"h":100,"resize":"crop"},"small":{"w":100,"h":100,"resize":"fit"},"large":{"w":100,"h":100,"resize":"fit"}}}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"de"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_2_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"has_extended_profile":false,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false} -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bear/python-twitter/da1e9986f179622fa2d85f5b125a3f12f3e63177/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_direct_messages.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from __future__ import unicode_literals, print_function 5 | 6 | import re 7 | 8 | import twitter 9 | 10 | import responses 11 | from responses import GET, POST 12 | 13 | DEFAULT_BASE_URL = re.compile(r'https?://api\.twitter.com/1\.1/.*') 14 | DEFAULT_UPLOAD_URL = re.compile(r'https?://upload\.twitter.com/1\.1/.*') 15 | 16 | global api 17 | api = twitter.Api('test', 'test', 'test', 'test', tweet_mode='extended') 18 | 19 | 20 | @responses.activate 21 | def test_get_direct_messages(): 22 | with open('testdata/direct_messages/get_direct_messages.json') as f: 23 | resp_data = f.read() 24 | responses.add(GET, DEFAULT_BASE_URL, body=resp_data) 25 | 26 | resp = api.GetDirectMessages(count=1, page=1) 27 | direct_message = resp[0] 28 | assert isinstance(resp, list) 29 | assert isinstance(direct_message, twitter.DirectMessage) 30 | assert direct_message.id == 678629245946433539 31 | 32 | try: 33 | resp = api.GetDirectMessages(count='asdf') 34 | assert 0 35 | except twitter.TwitterError as e: 36 | assert True 37 | 38 | 39 | @responses.activate 40 | def test_get_sent_direct_messages(): 41 | with open('testdata/direct_messages/get_sent_direct_messages.json') as f: 42 | resp_data = f.read() 43 | responses.add(GET, DEFAULT_BASE_URL, body=resp_data) 44 | 45 | resp = api.GetSentDirectMessages(count=1, page=1) 46 | direct_message = resp[0] 47 | assert isinstance(resp, list) 48 | assert isinstance(direct_message, twitter.DirectMessage) 49 | assert direct_message.id == 678629283007303683 50 | 51 | 52 | @responses.activate 53 | def test_post_direct_message(): 54 | with open('testdata/direct_messages/post_post_direct_message.json', 'r') as f: 55 | responses.add(POST, DEFAULT_BASE_URL, body=f.read()) 56 | resp = api.PostDirectMessage(user_id='372018022', 57 | text='hello') 58 | assert isinstance(resp, twitter.DirectMessage) 59 | assert resp.text == 'hello' 60 | 61 | 62 | @responses.activate 63 | def test_post_direct_message_with_media(): 64 | with open('testdata/direct_messages/post_post_direct_message.json', 'r') as f: 65 | responses.add(POST, DEFAULT_BASE_URL, body=f.read()) 66 | with open('testdata/post_upload_chunked_INIT.json') as f: 67 | responses.add(POST, DEFAULT_UPLOAD_URL, body=f.read()) 68 | 69 | resp = api.PostDirectMessage(user_id='372018022', 70 | text='hello', 71 | media_file_path='testdata/media/happy.jpg', 72 | media_type='dm_image') 73 | assert isinstance(resp, twitter.DirectMessage) 74 | assert resp.text == 'hello' 75 | 76 | 77 | @responses.activate 78 | def test_destroy_direct_message(): 79 | with open('testdata/direct_messages/post_destroy_direct_message.json', 'r') as f: 80 | responses.add(POST, DEFAULT_BASE_URL, body=f.read()) 81 | resp = api.DestroyDirectMessage(message_id=855194351294656515) 82 | 83 | assert isinstance(resp, twitter.DirectMessage) 84 | assert resp.id == 855194351294656515 85 | -------------------------------------------------------------------------------- /tests/test_error_handling.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | from __future__ import unicode_literals, print_function 3 | 4 | import json 5 | import re 6 | import sys 7 | import unittest 8 | import warnings 9 | 10 | import twitter 11 | import responses 12 | from responses import GET, POST 13 | 14 | warnings.filterwarnings('ignore', category=DeprecationWarning) 15 | 16 | DEFAULT_URL = re.compile(r'https?://.*\.twitter.com/1\.1/.*') 17 | BODY = b'{"request":"\\/1.1\\/statuses\\/user_timeline.json","error":"Not authorized."}' 18 | 19 | 20 | class ApiTest(unittest.TestCase): 21 | 22 | def setUp(self): 23 | self.api = twitter.Api( 24 | consumer_key='test', 25 | consumer_secret='test', 26 | access_token_key='test', 27 | access_token_secret='test', 28 | sleep_on_rate_limit=False, 29 | chunk_size=500 * 1024) 30 | 31 | @responses.activate 32 | def testGetShortUrlLength(self): 33 | responses.add(GET, DEFAULT_URL, body=BODY, status=401) 34 | 35 | try: 36 | resp = self.api.GetUserTimeline(screen_name="twitter") 37 | except twitter.TwitterError as e: 38 | self.assertEqual(e.message, "Not authorized.") 39 | -------------------------------------------------------------------------------- /tests/test_filecache.py: -------------------------------------------------------------------------------- 1 | import twitter 2 | import unittest 3 | import time 4 | 5 | 6 | class FileCacheTest(unittest.TestCase): 7 | def testInit(self): 8 | """Test the twitter._FileCache constructor""" 9 | cache = twitter._FileCache() 10 | self.assertTrue(cache is not None, 'cache is None') 11 | 12 | def testSet(self): 13 | """Test the twitter._FileCache.Set method""" 14 | cache = twitter._FileCache() 15 | cache.Set("foo", 'Hello World!') 16 | cache.Remove("foo") 17 | 18 | def testRemove(self): 19 | """Test the twitter._FileCache.Remove method""" 20 | cache = twitter._FileCache() 21 | cache.Set("foo", 'Hello World!') 22 | cache.Remove("foo") 23 | data = cache.Get("foo") 24 | self.assertEqual(data, None, 'data is not None') 25 | 26 | def testGet(self): 27 | """Test the twitter._FileCache.Get method""" 28 | cache = twitter._FileCache() 29 | cache.Set("foo", 'Hello World!') 30 | data = cache.Get("foo") 31 | self.assertEqual('Hello World!', data) 32 | cache.Remove("foo") 33 | 34 | def testGetCachedTime(self): 35 | """Test the twitter._FileCache.GetCachedTime method""" 36 | now = time.time() 37 | cache = twitter._FileCache() 38 | cache.Set("foo", 'Hello World!') 39 | cached_time = cache.GetCachedTime("foo") 40 | delta = cached_time - now 41 | self.assertTrue(delta <= 1, 42 | 'Cached time differs from clock time by more than 1 second.') 43 | cache.Remove("foo") 44 | -------------------------------------------------------------------------------- /tests/test_friendship.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | from __future__ import unicode_literals, print_function 3 | 4 | import json 5 | import os 6 | import re 7 | import sys 8 | from tempfile import NamedTemporaryFile 9 | import unittest 10 | try: 11 | from unittest.mock import patch 12 | except ImportError: 13 | from mock import patch 14 | import warnings 15 | 16 | import twitter 17 | 18 | import responses 19 | from responses import GET, POST 20 | 21 | warnings.filterwarnings('ignore', category=DeprecationWarning) 22 | 23 | 24 | DEFAULT_URL = re.compile(r'https?://.*\.twitter.com/1\.1/.*') 25 | 26 | 27 | class ErrNull(object): 28 | """ Suppress output of tests while writing to stdout or stderr. This just 29 | takes in data and does nothing with it. 30 | """ 31 | 32 | def write(self, data): 33 | pass 34 | 35 | 36 | class ApiTest(unittest.TestCase): 37 | 38 | def setUp(self): 39 | self.api = twitter.Api( 40 | consumer_key='test', 41 | consumer_secret='test', 42 | access_token_key='test', 43 | access_token_secret='test', 44 | sleep_on_rate_limit=False, 45 | chunk_size=500 * 1024) 46 | self.base_url = 'https://api.twitter.com/1.1' 47 | self._stderr = sys.stderr 48 | sys.stderr = ErrNull() 49 | 50 | def tearDown(self): 51 | sys.stderr = self._stderr 52 | pass 53 | 54 | @responses.activate 55 | def testCreateFriendship(self): 56 | with open('testdata/create_friendship.json') as f: 57 | resp_data = f.read() 58 | responses.add(POST, DEFAULT_URL, body=resp_data) 59 | 60 | resp = self.api.CreateFriendship(screen_name='facebook') 61 | self.assertTrue(type(resp), twitter.User) 62 | 63 | self.assertRaises( 64 | twitter.TwitterError, 65 | lambda: self.api.CreateFriendship(user_id=None, screen_name=None)) 66 | 67 | @responses.activate 68 | def testUpdateFriendship(self): 69 | with open('testdata/update_friendship.json') as f: 70 | resp_data = f.read() 71 | responses.add(POST, DEFAULT_URL, body=resp_data) 72 | 73 | resp = self.api.UpdateFriendship(user_id=2425151, retweets=False) 74 | self.assertTrue(type(resp), twitter.User) 75 | 76 | @responses.activate 77 | def testDestroyFriendship(self): 78 | with open('testdata/destroy_friendship.json') as f: 79 | resp_data = f.read() 80 | responses.add(POST, DEFAULT_URL, body=resp_data) 81 | 82 | resp = self.api.DestroyFriendship(user_id=2425151) 83 | self.assertTrue(type(resp), twitter.User) 84 | 85 | resp = self.api.DestroyFriendship(screen_name='facebook') 86 | self.assertTrue(type(resp), twitter.User) 87 | 88 | self.assertRaises( 89 | twitter.TwitterError, 90 | lambda: self.api.DestroyFriendship(user_id=None, screen_name=None)) 91 | -------------------------------------------------------------------------------- /tests/test_parse_tweet.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | import unittest 4 | import twitter 5 | 6 | 7 | class ParseTest(unittest.TestCase): 8 | """ Test the ParseTweet class """ 9 | 10 | def testParseTweets(self): 11 | handles4 = u"""Do not use this word! Hurting me! @raja7727: @qadirbasha @manion @Jayks3 உடன்பிறப்பு”""" 12 | 13 | data = twitter.ParseTweet("@twitter", handles4) 14 | self.assertEqual([data.RT, data.MT, len(data.UserHandles)], [False, False, 4]) 15 | 16 | hashtag_n_URL = u"""மனதிற்கு மிகவும் நெருக்கமான பாடல்! உயிரையே கொடுக்கலாம் சார்! #KeladiKanmani https://www.youtube.com/watch?v=FHTiG_g2fM4 … #HBdayRajaSir""" 17 | 18 | data = twitter.ParseTweet("@twitter", hashtag_n_URL) 19 | self.assertEqual([len(data.Hashtags), len(data.URLs)], [2, 1]) 20 | self.assertEqual(len(data.Emoticon), 0) 21 | 22 | url_only = u"""The #Rainbow #Nebula, 544,667 #lightyears away. pic.twitter.com/2A4wSUK25A""" 23 | data = twitter.ParseTweet("@twitter", url_only) 24 | self.assertEqual([data.MT, len(data.Hashtags), len(data.URLs)], [False, 3, 1]) 25 | self.assertEqual(len(data.Emoticon), 0) 26 | 27 | url_handle = u"""RT ‏@BarackObama POTUS recommends Python-Twitter #unrelated picture pic.twitter.com/w8lFIfuUmI""" 28 | data = twitter.ParseTweet("@twitter", url_handle) 29 | self.assertEqual([data.RT, len(data.Hashtags), len(data.URLs), len(data.UserHandles)], [True, 1, 1, 1]) 30 | self.assertEqual(len(data.Emoticon), 0) 31 | 32 | def testEmoticon(self): 33 | url_handle = u"""RT ‏@BarackObama POTUS recommends :-) Python-Twitter #unrelated picture pic.twitter.com/w8lFIfuUmI""" 34 | data = twitter.ParseTweet("@twitter", url_handle) 35 | self.assertEqual([data.RT, len(data.Hashtags), len(data.URLs), len(data.UserHandles)], [True, 1, 1, 1]) 36 | self.assertEqual(len(data.Emoticon), 1) 37 | 38 | url_handle = u"""RT @cats ^-^ cute! But kitty litter :-( #unrelated picture""" 39 | data = twitter.ParseTweet("@cats", url_handle) 40 | self.assertEqual([data.RT, len(data.Hashtags), len(data.URLs), len(data.UserHandles)], [True, 1, 0, 1]) 41 | self.assertEqual(len(data.Emoticon), 2) 42 | self.assertEqual(data.Emoticon, ['^-^', ':-(']) 43 | -------------------------------------------------------------------------------- /tests/test_status_place.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | import re 3 | import sys 4 | import twitter 5 | import responses 6 | from responses import GET, POST 7 | 8 | DEFAULT_URL = re.compile(r'https?://.*\.twitter.com/1\.1/.*') 9 | 10 | 11 | class ErrNull(object): 12 | """ Suppress output of tests while writing to stdout or stderr. This just 13 | takes in data and does nothing with it. 14 | """ 15 | 16 | def write(self, data): 17 | pass 18 | 19 | 20 | class ApiPlaceTest(unittest.TestCase): 21 | def setUp(self): 22 | self.api = twitter.Api( 23 | consumer_key='test', 24 | consumer_secret='test', 25 | access_token_key='test', 26 | access_token_secret='test' 27 | ) 28 | self.base_url = 'https://api.twitter.com/1.1' 29 | self._stderr = sys.stderr 30 | sys.stderr = ErrNull() 31 | 32 | def tearDown(self): 33 | sys.stderr = self._stderr 34 | pass 35 | 36 | @responses.activate 37 | def testGetStatusWithPlace(self): 38 | with open('testdata/get_status_with_place.json') as f: 39 | resp_data = f.read() 40 | responses.add(GET, DEFAULT_URL, body=resp_data) 41 | 42 | resp = self.api.GetStatus(1051204790334746624) 43 | self.assertTrue(isinstance(resp, twitter.Status)) 44 | self.assertTrue(isinstance(resp.place, twitter.Place)) 45 | self.assertEqual(resp.id, 1051204790334746624) 46 | 47 | @responses.activate 48 | def testPostUpdateWithPlace(self): 49 | with open('testdata/post_update_with_place.json') as f: 50 | resp_data = f.read() 51 | responses.add(POST, DEFAULT_URL, body=resp_data, status=200) 52 | 53 | post = self.api.PostUpdate('test place', place_id='07d9db48bc083000') 54 | self.assertEqual(post.place.id, '07d9db48bc083000') 55 | -------------------------------------------------------------------------------- /tests/test_streaming.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | from __future__ import unicode_literals, print_function 5 | 6 | import json 7 | import unittest 8 | 9 | import twitter 10 | 11 | 12 | def test_streaming_extended_tweet(): 13 | with open('testdata/streaming/streaming_extended_tweet.json') as f: 14 | tweet = twitter.Status.NewFromJsonDict(json.loads(f.read())) 15 | 16 | assert isinstance(tweet, twitter.Status) 17 | assert tweet.text == "HIV_AIDS_BiojQuery Mobile Web Development Essentials, Second Edition: https://t.co/r78h6xfAby Quantum AI Big/Small/… https://t.co/ZPJrpMvcZG" 18 | assert tweet.truncated 19 | assert tweet.full_text == 'HIV_AIDS_BiojQuery Mobile Web Development Essentials, Second Edition: https://t.co/r78h6xfAby Quantum AI Big/Small/0 Data Cloud/Fog Computing OutLook from ClouData & Multiverse - https://t.co/cnCBNJvu6T' 20 | 21 | 22 | def test_streaming_extended_tweet_media(): 23 | with open('testdata/streaming/lines.json') as f: 24 | tweets = f.readlines() 25 | 26 | for tweet in tweets: 27 | status = twitter.Status.NewFromJsonDict(json.loads(tweet)) 28 | assert isinstance(status, twitter.Status) 29 | assert status.full_text 30 | -------------------------------------------------------------------------------- /tests/test_trend.py: -------------------------------------------------------------------------------- 1 | import twitter 2 | import unittest 3 | import json 4 | 5 | 6 | class TrendTest(unittest.TestCase): 7 | SAMPLE_JSON = '''{"name": "Kesuke Miyagi", "query": "Kesuke Miyagi"}''' 8 | 9 | def _GetSampleTrend(self): 10 | return twitter.Trend(name='Kesuke Miyagi', 11 | query='Kesuke Miyagi', 12 | timestamp='Fri Jan 26 23:17:14 +0000 2007') 13 | 14 | def testInit(self): 15 | '''Test the twitter.Trend constructor''' 16 | twitter.Trend(name='Kesuke Miyagi', 17 | query='Kesuke Miyagi', 18 | timestamp='Fri Jan 26 23:17:14 +0000 2007') 19 | 20 | def testProperties(self): 21 | '''Test all of the twitter.Trend properties''' 22 | trend = twitter.Trend() 23 | trend.name = 'Kesuke Miyagi' 24 | self.assertEqual('Kesuke Miyagi', trend.name) 25 | trend.query = 'Kesuke Miyagi' 26 | self.assertEqual('Kesuke Miyagi', trend.query) 27 | trend.timestamp = 'Fri Jan 26 23:17:14 +0000 2007' 28 | self.assertEqual('Fri Jan 26 23:17:14 +0000 2007', trend.timestamp) 29 | 30 | def testNewFromJsonDict(self): 31 | '''Test the twitter.Trend NewFromJsonDict method''' 32 | data = json.loads(TrendTest.SAMPLE_JSON) 33 | trend = twitter.Trend.NewFromJsonDict(data, timestamp='Fri Jan 26 23:17:14 +0000 2007') 34 | self.assertEqual(self._GetSampleTrend(), trend) 35 | 36 | def testEq(self): 37 | '''Test the twitter.Trend __eq__ method''' 38 | trend = twitter.Trend() 39 | trend.name = 'Kesuke Miyagi' 40 | trend.query = 'Kesuke Miyagi' 41 | trend.timestamp = 'Fri Jan 26 23:17:14 +0000 2007' 42 | self.assertEqual(trend, self._GetSampleTrend()) 43 | 44 | def testHash(self): 45 | '''Test the twitter.Trent __hash__ method''' 46 | trend = self._GetSampleTrend() 47 | with self.assertRaises(TypeError) as context: 48 | hash(trend) 49 | self.assertIn('unhashable type: {} (no id attribute)' 50 | .format(type(trend)), str(context.exception)) 51 | -------------------------------------------------------------------------------- /tests/test_tweet_changes.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | from __future__ import unicode_literals, print_function 3 | 4 | import json 5 | import re 6 | import sys 7 | import unittest 8 | import warnings 9 | 10 | import twitter 11 | import responses 12 | from responses import GET 13 | 14 | warnings.filterwarnings('ignore', category=DeprecationWarning) 15 | 16 | DEFAULT_URL = re.compile(r'https?://.*\.twitter.com/1\.1/.*') 17 | 18 | 19 | class ModelsChangesTest(unittest.TestCase): 20 | """Test how changes to tweets affect model creation""" 21 | 22 | def setUp(self): 23 | self.api = twitter.Api( 24 | consumer_key='test', 25 | consumer_secret='test', 26 | access_token_key='test', 27 | access_token_secret='test', 28 | sleep_on_rate_limit=False) 29 | 30 | @responses.activate 31 | def test_extended_in_compat_mode(self): 32 | """API is in compatibility mode, but we call GetStatus on a tweet that 33 | was written in extended mode. 34 | 35 | The tweet in question is exactly 140 characters and attaches a photo. 36 | 37 | """ 38 | with open('testdata/3.2/extended_tweet_in_compat_mode.json') as f: 39 | resp_data = f.read() 40 | status = twitter.Status.NewFromJsonDict(json.loads(resp_data)) 41 | self.assertTrue(status) 42 | self.assertEqual(status.id, 782737772490600448) 43 | self.assertEqual(status.text, "has more details about these changes. Thanks for making more expressive!writing requirements to python_twitt pytho… https://t.co/et3OTOxWSa") 44 | self.assertEqual(status.tweet_mode, 'compatibility') 45 | self.assertTrue(status.truncated) 46 | 47 | @responses.activate 48 | def test_extended_in_extended_mode(self): 49 | """API is in extended mode, and we call GetStatus on a tweet that 50 | was written in extended mode. 51 | 52 | The tweet in question is exactly 140 characters and attaches a photo. 53 | 54 | """ 55 | with open('testdata/3.2/extended_tweet_in_extended_mode.json') as f: 56 | resp_data = f.read() 57 | status = twitter.Status.NewFromJsonDict(json.loads(resp_data)) 58 | self.assertTrue(status) 59 | self.assertEqual(status.id, 782737772490600448) 60 | self.assertEqual(status.full_text, "has more details about these changes. Thanks for making more expressive!writing requirements to python_twitt python_twitter.egg-info/SOURCE https://t.co/JWSPztfoyt") 61 | self.assertEqual(status.tweet_mode, 'extended') 62 | self.assertFalse(status.truncated) 63 | -------------------------------------------------------------------------------- /tests/test_unicode.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | import json 4 | import pickle 5 | import re 6 | import sys 7 | import unittest 8 | import warnings 9 | 10 | import responses 11 | 12 | from hypothesis import given, example 13 | from hypothesis import strategies as st 14 | 15 | import twitter 16 | 17 | warnings.filterwarnings('ignore', category=DeprecationWarning) 18 | 19 | DEFAULT_URL = re.compile(r'https?://.*\.twitter.com/1\.1/.*') 20 | 21 | 22 | class ErrNull(object): 23 | """ Suppress output of tests while writing to stdout or stderr. This just 24 | takes in data and does nothing with it. 25 | """ 26 | 27 | def write(self, data): 28 | pass 29 | 30 | 31 | class ApiTest(unittest.TestCase): 32 | def setUp(self): 33 | self.maxDiff = None 34 | self.api = twitter.Api( 35 | consumer_key='test', 36 | consumer_secret='test', 37 | access_token_key='test', 38 | access_token_secret='test', 39 | sleep_on_rate_limit=False) 40 | self.base_url = 'https://api.twitter.com/1.1' 41 | self._stderr = sys.stderr 42 | sys.stderr = ErrNull() 43 | 44 | def tearDown(self): 45 | sys.stderr = self._stderr 46 | pass 47 | 48 | @given(text=st.text()) 49 | @example(text="#نفسك_تبيع_ايه_للسعوديه") 50 | def test_trend_repr1(self, text): 51 | trend = twitter.Trend( 52 | name=text, 53 | url="http://twitter.com/search?q=%23ChangeAConsonantSpoilAMovie", 54 | timestamp='whatever') 55 | try: 56 | trend.__repr__() 57 | except Exception as e: 58 | self.fail(e) 59 | 60 | @given(text=st.text()) 61 | @example(text="#N\u00e3oD\u00eaUnfTagueirosSdv") 62 | def test_trend_repr2(self, text): 63 | trend = twitter.Trend( 64 | url='http://twitter.com/search?q=%23ChangeAConsonantSpoilAMovie', 65 | timestamp='whatever') 66 | 67 | try: 68 | trend.__repr__() 69 | except Exception as e: 70 | self.fail(e) 71 | 72 | @responses.activate 73 | def test_trend_repr3(self): 74 | with open('testdata/get_trends_current_unicode.json', 'r') as f: 75 | resp_data = f.read() 76 | 77 | responses.add( 78 | responses.GET, DEFAULT_URL, body=resp_data, match_querystring=True) 79 | 80 | resp = self.api.GetTrendsCurrent() 81 | for r in resp: 82 | try: 83 | r.__repr__() 84 | except Exception as e: 85 | self.fail(e) 86 | 87 | @given(text=st.text()) 88 | @responses.activate 89 | def test_unicode_get_search(self, text): 90 | responses.add(responses.GET, DEFAULT_URL, body=b'{}', status=200) 91 | try: 92 | self.api.GetSearch(term=text) 93 | except Exception as e: 94 | self.fail(e) 95 | 96 | @given(text=st.text()) 97 | @example(text='可以倒着飞的飞机') 98 | def test_constructed_status(self, text): 99 | s = twitter.Status() 100 | s.text = text 101 | s.created_at = "016-02-13T23:00:00" 102 | s.screen_name = "himawari8bot" 103 | s.id = 1 104 | try: 105 | s.__repr__() 106 | except Exception as e: 107 | self.fail(e) 108 | 109 | def test_post_with_bytes_string(self): 110 | status = 'x' 111 | length = twitter.twitter_utils.calc_expected_status_length(status) 112 | assert length == 1 113 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = clean,py27,py37,pypy,pypy3,codestyle,coverage 3 | skip_missing_interpreters = True 4 | 5 | [testenv] 6 | deps = -Ur{toxinidir}/requirements.txt 7 | -Ur{toxinidir}/requirements.testing.txt 8 | 9 | commands = coverage run --parallel-mode --source=twitter setup.py test --addopts "--ignore=venv" 10 | 11 | whitelist_externals = /bin/bash 12 | make 13 | setenv = 14 | PYTHONWARNINGS=always::DeprecationWarning 15 | 16 | [testenv:clean] 17 | deps = coverage 18 | commands = coverage erase 19 | 20 | [testenv:coverage] 21 | deps = coverage 22 | commands = coverage combine 23 | coverage html 24 | coverage report 25 | 26 | 27 | [testenv:codestyle] 28 | deps = pycodestyle 29 | commands = pycodestyle --config={toxinidir}/setup.cfg twitter tests 30 | -------------------------------------------------------------------------------- /twitter/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2007-2018 The Python-Twitter Developers 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """A library that provides a Python interface to the Twitter API.""" 19 | from __future__ import absolute_import 20 | 21 | __author__ = 'The Python-Twitter Developers' 22 | __email__ = 'python-twitter@googlegroups.com' 23 | __copyright__ = 'Copyright (c) 2007-2016 The Python-Twitter Developers' 24 | __license__ = 'Apache License 2.0' 25 | __version__ = '3.5' 26 | __url__ = 'https://github.com/bear/python-twitter' 27 | __download_url__ = 'https://pypi.python.org/pypi/python-twitter' 28 | __description__ = 'A Python wrapper around the Twitter API' 29 | 30 | 31 | import json # noqa 32 | 33 | try: 34 | from hashlib import md5 # noqa 35 | except ImportError: 36 | from md5 import md5 # noqa 37 | 38 | from ._file_cache import _FileCache # noqa 39 | from .error import TwitterError # noqa 40 | from .parse_tweet import ParseTweet # noqa 41 | 42 | from .models import ( # noqa 43 | Category, # noqa 44 | DirectMessage, # noqa 45 | Hashtag, # noqa 46 | List, # noqa 47 | Media, # noqa 48 | Place, # noga 49 | Trend, # noqa 50 | Url, # noqa 51 | User, # noqa 52 | UserStatus, # noqa 53 | Status # noqa 54 | ) 55 | 56 | from .api import Api # noqa 57 | -------------------------------------------------------------------------------- /twitter/error.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | 4 | class TwitterError(Exception): 5 | """Base class for Twitter errors""" 6 | 7 | @property 8 | def message(self): 9 | '''Returns the first argument used to construct this error.''' 10 | return self.args[0] 11 | 12 | 13 | class PythonTwitterDeprecationWarning(DeprecationWarning): 14 | """Base class for python-twitter deprecation warnings""" 15 | pass 16 | 17 | 18 | class PythonTwitterDeprecationWarning330(PythonTwitterDeprecationWarning): 19 | """Warning for features to be removed in version 3.3.0""" 20 | pass 21 | 22 | 23 | class PythonTwitterDeprecationWarning340(PythonTwitterDeprecationWarning): 24 | """Warning for features to be removed in version 3.4.0""" 25 | pass 26 | --------------------------------------------------------------------------------