Skip to content

dqn/go-tw-xauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-tw-xauth

Twitter xAuth in Go.

Installation

$ go get github.com/dqn/go-tw-xauth

Usage

package main

import (
	"fmt"

	"github.com/dqn/go-tw-xauth/xauth"
)

func main() {
	resp, err := xauth.Do("CONSUMER_KEY", "CONSUMER_SECRET", "SCREEN_NAME", "PASSWORD")
	if err != nil {
		// Handle error
	}

	fmt.Println("oauth token:", resp.OauthToken)
	fmt.Println("oauth token secret:", resp.OauthTokenSecret)
	fmt.Println("screen name:", resp.ScreenName)
	fmt.Println("user id:", resp.UserID)
	fmt.Println("xauth expires:", resp.XAuthExpires)
}

CLI

$ go get github.com/dqn/go-tw-xauth/cmd/xauth
$ xauth <consumer-key> <consumer-secret> <screen-name> <password>
oauth token: XXXXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
oauth token secret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
screen name: XXXXX
user id: XXXXXXXXXXXXXXXXXX
xauth expires: 0

License

MIT

About

Twitter xAuth in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages