new twitter widget in admin, deleted old
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.4.7-stable+timestamp.2013.05.31.08.19.48
|
||||
Version 2.4.7-stable+timestamp.2013.05.31.08.28.32
|
||||
|
||||
@@ -1677,26 +1677,6 @@ def update_languages():
|
||||
redirect(URL('design', args=app, anchor='languages'))
|
||||
|
||||
|
||||
def twitter():
|
||||
session.forget()
|
||||
session._unlock(response)
|
||||
import gluon.tools
|
||||
import gluon.contrib.simplejson as sj
|
||||
try:
|
||||
if TWITTER_HASH:
|
||||
page = urllib.urlopen("http://search.twitter.com/search.json?q=%%40%s" % TWITTER_HASH).read()
|
||||
data = sj.loads(page, encoding="utf-8")['results']
|
||||
d = dict()
|
||||
for e in data:
|
||||
d[e["id"]] = e
|
||||
r = reversed(sorted(d))
|
||||
return dict(tweets=[d[k] for k in r])
|
||||
else:
|
||||
return 'disabled'
|
||||
except Exception, e:
|
||||
return DIV(T('Unable to download because:'), BR(), str(e))
|
||||
|
||||
|
||||
def user():
|
||||
if MULTI_USER_MODE:
|
||||
if not db(db.auth_user).count():
|
||||
|
||||
@@ -147,14 +147,6 @@
|
||||
</div> <!-- /APP WIZARD -->
|
||||
<a class="twitter-timeline" href="https://twitter.com/web2py" data-widget-id="340456915207327745">Tweets by @web2py</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||||
{{if False and TWITTER_HASH:}}
|
||||
<!-- TWITTER -->
|
||||
<div class="box">
|
||||
<h4>{{=T("%s Recent Tweets"%TWITTER_HASH)}}</h4>
|
||||
<div id="tweets">{{=T('loading...')}}</div>
|
||||
<script>jQuery(document).ready(function(){jQuery('#tweets').load('{{=URL('twitter.load')}}');});</script>
|
||||
</div> <!-- /TWITTER -->
|
||||
{{pass}}
|
||||
</div>
|
||||
</div> <!-- /sidebar -->
|
||||
</div> <!-- /row-fluid
|
||||
|
||||
Reference in New Issue
Block a user