urlize twitter feed

This commit is contained in:
Sanj 2011-10-24 16:37:01 +01:00
parent 8a67c196d8
commit d7afdc59f5
2 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import twitter
from django.template import RequestContext
from django import forms
from django.forms.widgets import Textarea
from django.utils.html import urlize
class ContactForm(forms.Form):
email = forms.EmailField()
@ -22,12 +23,12 @@ class ContactForm(forms.Form):
def index(request):
try:
tApi = twitter.Api()
statuses = tApi.GetUserTimeline(TWITTER_ID)
statuses = tApi.GetUserTimeline(TWITTER_ID)[0:3]
except:
statuses = []
boxes = SliderBox.objects.all()
return render_to_response("noel/index.html", RequestContext(request, {
'tweets': statuses[0:5],
'tweets': [urlize(s.text) for s in statuses],
'boxes': boxes
}))

View File

@ -40,7 +40,7 @@
<div id="contentTab">
<ul>
{% for t in tweets %}
<li>{{ t.text }}</li>
<li>{{ t|safe }}</li>
{% endfor %}
<!--
<li>@dootah there's a new play this weekend. <span>bit.ly/xYr3dD</span></li>