source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/applications/admin/views/default/twitter.load

main
Last change on this file was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 947 bytes
Line 
1{{response.headers['web2py-response-flash']=response.flash}}
2
3{{
4"""
5Tweet attributes
6
7'iso_language_code',
8'to_user_name',
9'to_user_id_str',
10'profile_image_url_https',
11'from_user_id_str',
12'text',
13'from_user_name',
14'in_reply_to_status_id_str',
15'profile_image_url',
16'id',
17'to_user',
18'source',
19'in_reply_to_status_id',
20'id_str',
21'from_user',
22'from_user_id',
23'to_user_id',
24'geo',
25'created_at',
26'metadata'
27"""
28}}
29
30{{import re}}
31{{hashtag = re.compile('([#@])(\w+)')}}
32{{link = re.compile('(?!<")https?\:\/\/[\w\./?&]+')}}
33<table class="twitter">
34{{ for t in tweets: }}
35   <tr class="tweet">
36   <td><img src="{{=t['profile_image_url_https']}}"/></td>
37   <td>
38       <a href="http://twitter.com/{{=t['from_user']}}">{{=t["from_user_name"]}}</a>:
39              {{=XML(hashtag.sub('<a href="http://twitter.com/\\g<2>">\\g<1>\\g<2></a>',link.sub('<a href="\\g<0>">\\g<0></a>',t["text"].encode('utf8'))),sanitize=True)}}
40   </td>
41  </tr>
42{{ pass }}
43</table>
Note: See TracBrowser for help on using the repository browser.