Skip to content

Go module and cmd tool to get instagram access token programmatically

License

Notifications You must be signed in to change notification settings

heppu/instagram-token-fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
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.

About

Go module and cmd tool to get instagram access token programmatically

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages