forked from dagoof/go-instagram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.go
More file actions
31 lines (26 loc) · 694 Bytes
/
example.go
File metadata and controls
31 lines (26 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2013 The go-instagram AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"github.com/gedex/go-instagram/instagram"
"os"
)
func main() {
client := instagram.NewClient(nil)
client.ClientID = "8f2c0ad697ea4094beb2b1753b7cde9c"
// If you have access_token you can supply it
// client.AccessToken = ""
media, next, err := client.Media.Popular()
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
}
for _, m := range media {
fmt.Printf("ID: %v, Type: %v\n", m.ID, m.Type)
}
if next.NextURL != "" {
fmt.Println("Next URL", next.NextURL)
}
}