Source

web2itter / views / tweets / update_tweets.html

Full commit
{{from urllib import urlencode
import datetime
today = datetime.datetime.now() - datetime.timedelta(0, 10800)
yesterday = datetime.datetime.now() - datetime.timedelta(0, 10800) - datetime.timedelta(0, 86400)
for tweet in tweets:
    date = (tweet['date'] - BRT_offset)
    if date.day == today.day and date.month == today.month and date.year == today.year:
        date_date = 'today'
    elif date.day == yesterday.day and date.month == yesterday.month and date.year == yesterday.year:
        date_date = 'yesterday'
    else:
        date_date = '%02d/%02d/%d' % (date.day, date.month, date.year)
    pass
}}
		<li class="{{='more_tweet' if request.vars.get('more', None) else 'new_tweet'}}">
		    <a href="http://twitter.com/{{=tweet['author']}}">
    			<img src="{{=tweet['image']}}" alt="{{=tweet['author']}}'s avatar" width="48" height="48" />
    		</a>
			<p class="tweet"><a href="http://twitter.com/{{=tweet['author']}}">{{=tweet['author']}}</a>: {{=XML(put_links(tweet['tweet']))}} </p>
			<p class="msg">
			    <a href="http://twitter.com/{{=tweet['author']}}/status/{{=int(tweet['tweet_id'])}}" title="Permalink" target="_blank">{{=date_date}} at {{='%02d' % date.hour}}:{{='%02d' % date.minute}}:{{='%02d' % date.second}} BRT</a> from <em>{{=XML(tweet['source'])}}</em>
			    -
			    <a href="http://twitter.com/?{{=urlencode({'status': 'RT %s: %s' % (tweet['author'], tweet['tweet'])})}}" target="_blank">retweet</a>,
			    <a href="http://twitter.com/?status=@{{=tweet['author']}}%20" target="_blank">reply</a>
			 </p>
		</li>
</div>
{{pass}}