basically it's same like on the admin page, the different part is only the 
twitter user name.

*models/db.py*
TWITTER_HASH = "stifixid"

*controllers/default.py*
def twitter():
    session.forget()
    session._unlock(response)
    import urllib
    import gluon.tools
    import gluon.contrib.simplejson as sj
    try:
        if TWITTER_HASH:
            page = 
urllib.urlopen("http://search.twitter.com/search.json?q=%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 index():
    return dict()

*views/default/index.html*
{{extend 'layout_default.html'}}

<!-- TWITTER -->
<div class="box">
<h4>{{=T("Recent Tweets")}}</h4>
<div id="tweets">{{=T('loading...')}}</div>
<script>jQuery(document).ready(function(){jQuery('#tweets').load('{{=URL('twitter.load')}}');});</script>
</div>
<!-- /TWITTER -->

any idea why it's produce the errors? is it related to my twitter account? 
i'm trying to access my twitter account via twitter web is fine.
thanks and best regards

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to