{ "info": { "author": "Ilya Baryshev", "author_email": "baryshev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3" ], "description": "Django Twitter Tag\n==================\n\n.. image:: https://secure.travis-ci.org/coagulant/django-twitter-tag.png?branch=dev\n :target: https://travis-ci.org/coagulant/django-twitter-tag\n\n.. image:: https://coveralls.io/repos/coagulant/django-twitter-tag/badge.png?branch=dev\n :target: https://coveralls.io/r/coagulant/django-twitter-tag/\n\nA django template tag to display user's recent tweets / search results.\nVersion 1.0 uses Twitter API 1.1.\n\nBasic features are limiting numbers of displayed tweets, filtering out replies and retweets.\nLibrary exposes each tweet ``json`` in template, adding extra attributes: ``html`` and ``datetime``.\nFirst one makes urls, hashtags or twitter usernames clickable, juts like you expect them to be.\nLast one provides python datetime object to ease output in templates.\nUrls are expanded by default. Library handles twitter exceptions gracefully,\nreturning last successful response.\n\nUsage\n-----\n\n* Load tag in your template like this::\n\n {% load twitter_tag %}\n\n\n* Get user's (``futurecolors`` in example) most recent tweets and store them in ``tweets`` variable::\n\n {% get_tweets for \"futurecolors\" as tweets %}\n\n\n* Now you have a list of tweets in your template context, which you can iterate over like this::\n\n \n\n\nInstallation\n------------\n\nThis app works with python 2.7 and 3.3, Django 1.4-1.6.\n\nRecommended way to install is pip::\n\n pip install django-twitter-tag\n\n\nAdd ``twitter_tag`` to ``INSTALLED_APPS`` in settings.py::\n\n INSTALLED_APPS = (...\n 'twitter_tag',\n ...\n )\n\nConfiguration\n-------------\n\nTwitter `API 1.1`_ requires authentication for every request you make,\nso you have to provide some credentials for oauth dance to work.\nFirst, `create an application`_, second, request access token on newly created\napp page. The `process of obtaining a token`_ is explained in detail in docs.\n\nHere is an example of how your config might look like::\n\n # settings.py\n # Make sure to replace with your own values, theses are just made up\n\n # Your access token: Access token\n TWITTER_OAUTH_TOKEN = '91570701-BQMM5Ix9AJUC5JtM5Ix9DtwNAiaaYIYGN2CyPgduPVZKSX'\n # Your access token: Access token secret\n TWITTER_OAUTH_SECRET = 'hi1UiXm8rF4essN3HlaqMz7GoUvy3e4DsVkBAVsg4M'\n # OAuth settings: Consumer key\n TWITTER_CONSUMER_KEY = '3edIOec4uu00IGFxvQcwJe'\n # OAuth settings: Consumer secret\n TWITTER_CONSUMER_SECRET = 'YBD6GyFpvumNbNA218RAphszFnkifxR8K9h8Rdtq1A'\n\nFor best performance you should set up `django cache framework`_. Cache is used both internally\nto store last successful json response and externally (see Caching below).\n\n.. _API 1.1: https://dev.twitter.com/docs/api/1.1\n.. _create an application: https://dev.twitter.com/apps\n.. _process of obtaining a token: https://dev.twitter.com/docs/auth/tokens-devtwittercom\n.. _django cache framework: https://docs.djangoproject.com/en/dev/topics/cache/\n\nExamples\n--------\n\nYou can specify number of tweets to show::\n\n {% get_tweets for \"futurecolors\" as tweets limit 10 %}\n\n\nTo filter out tweet replies (that start with @ char)::\n\n {% get_tweets for \"futurecolors\" as tweets exclude \"replies\" %}\n\n\nTo ignore native retweets::\n\n {% get_tweets for \"futurecolors\" as tweets exclude \"retweets\" %}\n\n\nOr everything from above together::\n\n {% get_tweets for \"futurecolors\" as tweets exclude \"replies, retweets\" limit 10 %}\n\n\nSearch tag (experimental)\n-------------------------\n\nYou can search for tweets::\n\n {% search_tweets for \"python 3\" as tweets limit 5 %}\n\nSearch api arguments are supported via key=value pairs::\n\n {% search_tweets for \"python 3\" as tweets lang='eu' result_type='popular' %}\n\nRelevant `API docs for search`_.\n\n.. _API docs for search: https://dev.twitter.com/docs/api/1.1/get/search/tweets\n\nCaching\n-------\n\nIt's strongly advised to use template caching framework to reduce the amount of twitter API calls\nand avoid reaching `rate limit`_ (currently, 180 reqs in 15 minutes)::\n\n {% load twitter_tag cache %}\n {% cache 60 my_tweets %}\n {% get_tweets for \"futurecolors\" as tweets exclude \"retweets\" %}\n ...\n {% endcache %}\n\n\n.. _rate limit: https://dev.twitter.com/docs/rate-limiting/1.1\n\nExtra\n-----\n\nTweet's properties\n~~~~~~~~~~~~~~~~~~\n\nget_tweets returns a list of tweets into context. Each tweets is a json dict, that has\nexactly the same attributes, as stated in API 1.1 docs, describing `tweet json`_.\nTweet's created timestamp is converted to python object and is available in templates::\n\n {{ tweet.datetime|date:\"D d M Y\" }}\n\n.. _tweet json: https://dev.twitter.com/docs/platform-objects/tweets\n\nTweet's html\n~~~~~~~~~~~~\n\nTweet also has extra ``html`` property, which contains tweet, formatted for html output\nwith all needed links. Note, Twitter has `guidelines for developers`_ on how embeded tweets\nshould look like.\n\n.. _guidelines for developers: https://dev.twitter.com/terms/display-requirements\n\nException handling\n~~~~~~~~~~~~~~~~~~\n\nAny Twitter API exceptions like 'Over capacity' are silenced and logged.\nDjango cache is used internally to store last successful response in case `twitter is down`_.\n\n.. _twitter is down: https://dev.twitter.com/docs/error-codes-responses\n\nGoing beyond\n~~~~~~~~~~~~\nSince version 1.0 you can create your own template tags for specific twitter queries,\nnot supported by this library. Simply inherit from ``twitter_tag.templatetags.twitter_tag.BaseTwitterTag``\nand implement your own ``get_json`` method (tag syntax is contolled by django-classy-tags).\n\nDevelopment\n-----------\n\nTo install `development version`_, use ``pip install django-twitter-tag==dev``\n\n.. _development version: https://github.com/coagulant/django-twitter-tag/archive/dev.tar.gz#egg=django_twitter_tag-dev\n\nTests\n-----\n\nRun::\n\n DJANGO_SETTINGS_MODULE = twitter_tag.test_settings python setup.py test", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/coagulant/django-twitter-tag", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-twitter-tag", "package_url": "https://pypi.org/project/django-twitter-tag/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-twitter-tag/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/coagulant/django-twitter-tag" }, "release_url": "https://pypi.org/project/django-twitter-tag/1.2.1/", "requires_dist": null, "requires_python": null, "summary": "A django template tag to display user's recent tweets.", "version": "1.2.1" }, "last_serial": 1846374, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "a90c15926f662eacab7be9522b6baceb", "sha256": "32ed49183aaa8b2f015bb4ed2bf6f26f19428d4f6494d339b0ac8f66cb855d5b" }, "downloads": -1, "filename": "django-twitter-tag-0.2.0.linux-x86_64.exe", "has_sig": false, "md5_digest": "a90c15926f662eacab7be9522b6baceb", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 70359, "upload_time": "2011-09-22T19:41:42", "url": "https://files.pythonhosted.org/packages/28/07/67cbe35df636dd4475dedf3c1dc1b8ea21d3ea2cf7d8c37261ef8be4dd98/django-twitter-tag-0.2.0.linux-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "fbf03ba2e80f2efd86a8020356998a5d", "sha256": "f708f313c83eb00070883c113cc151fed497a3759ae6423439c5dd2c54c6ccf2" }, "downloads": -1, "filename": "django-twitter-tag-0.2.0.tar.gz", "has_sig": false, "md5_digest": "fbf03ba2e80f2efd86a8020356998a5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5208, "upload_time": "2011-09-22T19:40:52", "url": "https://files.pythonhosted.org/packages/e7/2e/35ccf276e2455dce15fe85803eb64191d97a851ebe30bc2b1b49a131070e/django-twitter-tag-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "21925ed7626ab58f8786bc7c7eb8464c", "sha256": "0f5a03775cce99454385d3cf82cd8f7d2445670e3a65107b8ff6e38f54c11cc3" }, "downloads": -1, "filename": "django-twitter-tag-0.2.1.tar.gz", "has_sig": false, "md5_digest": "21925ed7626ab58f8786bc7c7eb8464c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5955, "upload_time": "2011-09-22T21:01:51", "url": "https://files.pythonhosted.org/packages/a6/1e/fb654fe090149d0e6caae2483c1013f54d96aa7b1c1e1d6676b0fb8a88cd/django-twitter-tag-0.2.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2cd025c68c9e9bf9635ac7b184c43116", "sha256": "15f0e4ccfd2299ad24fe05ab44cbc75972491479010dbe637fbf98c130343e42" }, "downloads": -1, "filename": "django-twitter-tag-0.3.tar.gz", "has_sig": false, "md5_digest": "2cd025c68c9e9bf9635ac7b184c43116", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6415, "upload_time": "2011-09-30T20:19:42", "url": "https://files.pythonhosted.org/packages/33/a9/e0b2fb574f2a3904271ddfec57af9cbffb42a22f122467f2cb7e6b9ffc39/django-twitter-tag-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a1fe98ca7bb9b07187e94e33108621c5", "sha256": "3e1620b1204834525569c07da5c59a2c2e6e094d44712f69b5e01b8ec973af44" }, "downloads": -1, "filename": "django-twitter-tag-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a1fe98ca7bb9b07187e94e33108621c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6522, "upload_time": "2011-10-03T19:22:19", "url": "https://files.pythonhosted.org/packages/a3/5c/ef6637b3d8a51bca2e1759a3e8a7aa00a39b0cb06d70c52a8c481ac501e9/django-twitter-tag-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "f7a7e9e2c390cf450801a5a73c49cdb7", "sha256": "0b992bd5e404e8473f7bf8322e571d9babde366faa58042d425fe7b421a27bbb" }, "downloads": -1, "filename": "django-twitter-tag-0.4.0.tar.gz", "has_sig": false, "md5_digest": "f7a7e9e2c390cf450801a5a73c49cdb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8780, "upload_time": "2012-03-31T21:34:01", "url": "https://files.pythonhosted.org/packages/ac/47/ffbd3456ebe5de0a7018b0e628163e3460d5b8ef17d9af2e94ece96d8a01/django-twitter-tag-0.4.0.tar.gz" } ], "0.4.0dev": [ { "comment_text": "", "digests": { "md5": "357f2d5a19ac0baf541da58254e3cfbf", "sha256": "895df58220bcfa23cbf02b19d1c03cd4161125ca8a9169c8130b68e78a98436a" }, "downloads": -1, "filename": "django-twitter-tag-0.4.0dev.tar.gz", "has_sig": false, "md5_digest": "357f2d5a19ac0baf541da58254e3cfbf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8610, "upload_time": "2012-03-10T19:18:43", "url": "https://files.pythonhosted.org/packages/f3/95/db60d5624120ab615c8c82f84011044232caad5b4294f77ee2a55875cc60/django-twitter-tag-0.4.0dev.tar.gz" } ], "0.4.0rc": [ { "comment_text": "", "digests": { "md5": "a4c082113452524e17ecc71de135a0c3", "sha256": "f5ac8ccacf4f63bf54b1ff45ef56e15f0c6fc9631e28b752590c219e1cf6db35" }, "downloads": -1, "filename": "django-twitter-tag-0.4.0rc.tar.gz", "has_sig": false, "md5_digest": "a4c082113452524e17ecc71de135a0c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8519, "upload_time": "2012-03-26T14:26:10", "url": "https://files.pythonhosted.org/packages/69/87/5266b808661f40fe9884878102073973b97402b472d3b9c64521ce530d52/django-twitter-tag-0.4.0rc.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "7b4b46fef20b76a7fd816527f3e2b27f", "sha256": "034067ad4d9e04dcb384c90fedc849397d6f575e76e44d0cc460e5c047251310" }, "downloads": -1, "filename": "django-twitter-tag-1.0.zip", "has_sig": false, "md5_digest": "7b4b46fef20b76a7fd816527f3e2b27f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18228, "upload_time": "2013-02-09T22:07:01", "url": "https://files.pythonhosted.org/packages/81/a0/ff28ae8dab94fd7ac15b8b2f42f1d844f00ede547d0db432ab0723f743ad/django-twitter-tag-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "965a96e26f7709e2c8b79341238fca82", "sha256": "1c3cd493d3b0c7c19e22ffe53ceebced9e8bec72d37bca4959c6a51b780f3706" }, "downloads": -1, "filename": "django-twitter-tag-1.1.zip", "has_sig": false, "md5_digest": "965a96e26f7709e2c8b79341238fca82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19322, "upload_time": "2013-02-24T11:08:43", "url": "https://files.pythonhosted.org/packages/75/30/83d2a142d59aab5a8c9227344614aec4b5c2fe5bc260e275c14c03cc8e4a/django-twitter-tag-1.1.zip" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "f5d958e506907e299aa56e9dab507982", "sha256": "4ae659f1c59473502987044a955685ce9732b8553f3c4766a21ebd91dc9186a4" }, "downloads": -1, "filename": "django-twitter-tag-1.1.1.zip", "has_sig": false, "md5_digest": "f5d958e506907e299aa56e9dab507982", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19492, "upload_time": "2013-03-16T15:44:38", "url": "https://files.pythonhosted.org/packages/56/3b/853882bdd9bbb4d5d604059742ff60da6ff8dc8bcc722a8541735156d51f/django-twitter-tag-1.1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "fc54c143c7410fe59464c93b26ac526c", "sha256": "82a813e44954c64e7534ddd16987eef308b013626f7097300a8266063617d01b" }, "downloads": -1, "filename": "django-twitter-tag-1.2.zip", "has_sig": false, "md5_digest": "fc54c143c7410fe59464c93b26ac526c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19477, "upload_time": "2013-05-10T19:20:47", "url": "https://files.pythonhosted.org/packages/ee/1b/e13409b292fe85b69edad20fa998d0975d5ac1f79b4754f5e756ff3182b1/django-twitter-tag-1.2.zip" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "f747fc64dcd61ddf262f4a7df7c4b3a8", "sha256": "349df9b592167b9f13e3e1fb07c9acd742ab5d425a8ee6bb85fb17109db46102" }, "downloads": -1, "filename": "django-twitter-tag-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f747fc64dcd61ddf262f4a7df7c4b3a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12103, "upload_time": "2015-12-04T11:56:16", "url": "https://files.pythonhosted.org/packages/76/30/8acf870d5a398ac10e38895ba92d0ec0d5bf6f837c62310024e47242b484/django-twitter-tag-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f747fc64dcd61ddf262f4a7df7c4b3a8", "sha256": "349df9b592167b9f13e3e1fb07c9acd742ab5d425a8ee6bb85fb17109db46102" }, "downloads": -1, "filename": "django-twitter-tag-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f747fc64dcd61ddf262f4a7df7c4b3a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12103, "upload_time": "2015-12-04T11:56:16", "url": "https://files.pythonhosted.org/packages/76/30/8acf870d5a398ac10e38895ba92d0ec0d5bf6f837c62310024e47242b484/django-twitter-tag-1.2.1.tar.gz" } ] }