Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heppu/instagram-token-fetcher

Go module and cmd tool to get instagram access token programmatically
https://github.com/heppu/instagram-token-fetcher

go instagram instagram-api

Last synced: about 2 months ago
JSON representation

Go module and cmd tool to get instagram access token programmatically

Awesome Lists containing this project

README

        

# Instagram token fetcher
This repository offers module for Go projects to fetch instagram access tokens programmatically.
It also has a command line tool for getting access tokens.

## Usage

In code:
```
go get github.com/heppu/instagram-token-fetcher
```

```go
package main

import (
"log"

"github.com/heppu/instagram-token-fetcher"
"gopkg.in/alecthomas/kingpin.v2"
)

func main() {
tokenClient := igtoken.NewClient(
"my-app-id",
"http://some-url.com:8888/token",
"some-user",
"some-passwd",
)

token, err := tokenClient.GetToken(igtoken.PUBLIC_CONTENT)
if err != nil {
log.Fatal(err)
return
}
log.Print(token)
}
```

From command line

```
go install github.com/heppu/instagram-token-fetcher/cmd/ig-token
ig-token --help
```

## How it works

First token client opens http server to listen redirect url and catch the access token. After that it creates http client with cookie jar and logins with user credentials by parsing data from html responses.