Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ljesparis/gostagram
Unofficial instagram client for go
https://github.com/ljesparis/gostagram
go golang golang-examples golang-library golang-package gostagram instagram instagram-api instagram-client instagram-lib instagram-photos instagram-sdk
Last synced: about 1 month ago
JSON representation
Unofficial instagram client for go
- Host: GitHub
- URL: https://github.com/ljesparis/gostagram
- Owner: ljesparis
- License: mit
- Archived: true
- Created: 2017-08-01T19:03:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-30T15:40:07.000Z (about 7 years ago)
- Last Synced: 2024-09-25T20:26:39.406Z (about 1 month ago)
- Topics: go, golang, golang-examples, golang-library, golang-package, gostagram, instagram, instagram-api, instagram-client, instagram-lib, instagram-photos, instagram-sdk
- Language: Go
- Homepage: https://godoc.org/github.com/ljesparis/gostagram
- Size: 585 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Gostagram
Unofficial and easy to use instagram client for go.
---
### Quick Start.
**Create Instagram Client**
Go to instagram developer [website](https://www.instagram.com/developer/)
and create a developer account, then register a new instagram client.**Implement Oauth2 Protocol**
Get the access token, implementing oauth2 [authorization protocol](https://en.wikipedia.org/wiki/OAuth).
I do recommmend [oauth2](https://github.com/golang/oauth2) for this job.
Here you can find an [oauth2 example](https://github.com/dorajistyle/goyangi/tree/master/util/oauth2).**Download and Installation**
```text
go get github.com/ljesparis/gostagram
```**Usage**
Basic example, using an client to
consume an instagram endpoint.```go
package mainimport (
"fmt"
"github.com/ljesparis/gostagram"
)func main() {
client := gostagram.NewClient("access_token")
user, err := client.GetCurrentUser()
if err != nil {
fmt.Println(err)
} else {
fmt.Println(user.Id)
fmt.Println(user.Username)
fmt.Println(user.FullName)
}
}
```If you want to enable instagram signed requests mode
you have to tell gostagram client, that you want to sig
a request.```go
package mainimport (
"fmt"
"github.com/ljesparis/gostagram"
)func main() {
client := gostagram.NewClient("access_token")
client.SetSignedRequest(true)
client.SetClientSecret("client secret")
tags, err := client.SearchTags("golang")
if err != nil {
fmt.Println(err)
} else {
for _, tag := range tags {
fmt.Println("Tag name: ", tag.Name)
}
}
}
```### Tests.
Before executing **gostagram** tests, please get access token, client secret
and complete every empty variable in all test file, why? well, that way you could
test every method with your own parameters, otherwise multiples errors will be
thrown.Note: test every method one by one, use the makefile to optimize that
process.### Support us.
* [donate](https://www.paypal.me/leoxnidas).
* [Contribute](https://github.com/leoxnidas/gostagram#contribute).
* Talk about the project.### Contribute.
Please use [Github issue tracker](https://github.com/leoxnidas/gostagram/issues)
for everything.
* Report issues.
* Improve/Fix documentation.
* Suggest new features or enhancements.### License.
gostagram license [MIT](./LICENSE.txt)