go-tw-xauth

module
v0.0.0-...-d63c054 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2020 License: MIT

README

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL