Sina Weibo Python site application certificate

Source: Internet
Author: User

On Sina Weibo's Python site, the app uses a credential to search for more than two oau22, why? Today, I used a python parser to write a sentence. In the next half, the author of Weibo's PythonSDK sent a private message to me (I have asked me about it), and the SDK was upgraded to version 1.0.9, and then click again... I have been the root of the http://blog.csdn.net/chenggong2dm/article/details/6613582 knock on the ten lines of the core of the agent, use the new SDK to buy the line on behalf of the agent to get started... the following shows the basic Token Generation. [Python] #! /Usr/bin/python #-*-coding: UTF-8-*-# handlers. py import web import setting from weibo import APIClient from jinja2 import Environment, FileSystemLoader env = Environment (loader = FileSystemLoader ('templates') class Redirect: def GET (self): web. found ('/') class Index: def GET (self): return env.get_template('goto_sina.html '). render () def POST (self): # oau2c = APIClient (setting. _ APP_KEY, se Invalid. _ APP_SECRET) data = c. parse_signed_request (web. data (). split ("=") [1]) if 'auth _ token' not in data: return env.get_template('unoauth.html '). render () c. set_access_token (data ['oss _ token'], data ['expires _ in']) sended = not 'rerror _ Code' in c. statuses. update. post (status = u'post Weibo ') return sended [python] # index. wsgi import sae import web from handlers import * #404 & 500 def notfound (): return Web. notfound ("Sorry, the page you were looking for was not found. ") def internalerror (): return web. internalerror ("Bad, bad server. no donut for you. ") # url settings urls = ('/? ', 'Index ','/. + ', 'redirect',) app = web. application (urls, globals () app. notfound = notfound # app. internalerror = internalerror application = sae. create_wsgi_app (app. wsgifunc () unoauth.html [html] <! Doctype html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.