资源说明:A django template tag to display user's recent tweets.
Django Twitter Tag ================== .. image:: https://secure.travis-ci.org/coagulant/django-twitter-tag.png?branch=dev :target: https://travis-ci.org/coagulant/django-twitter-tag .. image:: https://coveralls.io/repos/coagulant/django-twitter-tag/badge.png?branch=dev :target: https://coveralls.io/r/coagulant/django-twitter-tag/ A django template tag to display user's recent tweets / search results. Version 1.0 uses Twitter API 1.1. Basic features are limiting numbers of displayed tweets, filtering out replies and retweets. Library exposes each tweet ``json`` in template, adding extra attributes: ``html`` and ``datetime``. First one makes urls, hashtags or twitter usernames clickable, juts like you expect them to be. Last one provides python datetime object to ease output in templates. Urls are expanded by default. Library handles twitter exceptions gracefully, returning last successful response. Usage ----- * Load tag in your template like this:: {% load twitter_tag %} * Get user's (``futurecolors`` in example) most recent tweets and store them in ``tweets`` variable:: {% get_tweets for "futurecolors" as tweets %} * Now you have a list of tweets in your template context, which you can iterate over like this::
-
{% for tweet in tweets %}
- {{ tweet.html|safe }} {% endfor %}
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。