Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 20, 2019. It is now read-only.
/BiWeiboPublic archive

微博 OAuth2

NotificationsYou must be signed in to change notification settings

haozibi/BiWeibo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

微博 Oauth2 封装

  • Golang 版本 => Golang
  • Python3 版本 => Python3 + requests

OAuth2.0的封装

微博授权机制说明

使用方法: 注册微博App后,可以获得app key和app secret,然后定义网站回调地址

Python3 代码示例

fromBiOAuthimport*appKey='你的app key'appSecret='你的app secret'redirectUri='你的callback url'cookies='用户的cookie'a=BiOAuth(appKey=appKey,appSecret=appSecret,redirectUri=redirectUri,cookies=cookies)access_token=a.getAccessToken()

Golang 代码示例

go get github.com/haozibi/BiWeibo

package mainimport ("fmt"Oauth2"github.com/haozibi/BiWeibo/Oauth2-golang")funcmain() {a:= Oauth2.Oauth{AppKey:"你的AppKey",AppScret:"你的AppScret",RedirectUrl:"回调地址",Cookie:"你的Cookie",}fmt.Println(a.GetToken())}

由于一般是我个人使用,所以使用cookie判断登录

当拥有的access_token后就可以调用其他API,注意acces_token时效性即可

About

微博 OAuth2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp