我一直在敲打我的头两天,显然遗漏了一些东西.我对后端/服务器开发有一点想法,希望有人能指出我正确的方向.
问题
谢谢!
package main
import (
"code.google.com/p/goauth2/oauth"
"fmt"
"github.com/codegangsta/martini"
"io"
"net/http"
)
var config = &oauth.Config{
ClientId: CLIENT_ID,
ClientSecret: CLIENT_SECRET,
Scope: "identify",
AuthURL: "https://ssl.reddit.com/api/v1/authorize",
TokenURL: "https://ssl.reddit.com/api/v1/access_token",
RedirectURL: "http://localhost:3000/reddit_oauth",
}
func main() {
m := martini.Classic()
m.Get("/reddit_oauth", handleCallback)
m.Run()
}
func handleCallback(w http.ResponseWriter, r *http.Request) {
//Get the code from the response
code := r.FormValue("code")
// Exchange the received code for a token
t := &oauth.Transport{Config: config}
t.Exchange(code)
// Am I …Run Code Online (Sandbox Code Playgroud) 感谢您的阅读和您可能有的任何评论。
语境:
目标:
理想的情况是这样的:
windows: [ { windowHwnd:hwnd, windowText:windowText, windowX:x, windowY:y, windowWidth:width, windowHeight:height },
.
.
.
{ windowHwnd:hwnd, windowText:windowText, windowX:x, windowY:y, windowWidth:width, windowHeight:height } ]
Run Code Online (Sandbox Code Playgroud)我采取的步骤: