urlize twitter feed
This commit is contained in:
parent
8a67c196d8
commit
d7afdc59f5
|
@ -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
|
||||
}))
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user