-
Notifications
You must be signed in to change notification settings - Fork 1
/
cinstagram.go
92 lines (74 loc) · 2.07 KB
/
cinstagram.go
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* cinstagram
Instagram Bot - autofollow, like, comment dan unfollow not followback (c) Free Angel - [email protected]
please subscribe to my channel :
https://www.youtube.com/channel/UC15iFd0nlfG_tEBrt6Qz1NQ
*/
package main
import (
"fmt"
"time"
"github.com/ahmdrz/goinsta"
)
func cinstagram_main() {
fmt.Println("Hello World!")
}
type cInstagram struct {
enable bool
interval int64
photo_quality int // default 87
last_post int64
}
func (I *cInstagram) Initialize() {
I.last_post = time.Now().Unix()
}
func test() {
insta := goinsta.New("myjendhil", "cilacap2008")
if err := insta.Login(); err != nil {
panic(err)
}
defer insta.Logout()
fmt.Println("Logged In")
//insta.Explore()
id := insta.NewUploadID()
//res, err := insta.UploadVideo(mypath+"tmp/aS2PUzxGkihPJydE.mp4", mypath+"tmp/DYL3JJvVoAAGjar.jpg", "funny people", id)
res, err := insta.UploadPhoto(mypath+"tmp/broke.jpg", "Broke", id, 86, 0)
if err != nil {
fmt.Println(err)
// instagram error
} else {
fmt.Println("video posted :", id, "funny people", res.Status)
}
//res, err := insta.Like("1734295949923487387") //_3416684")
//
/* res, err := insta.Comment("1734295949923487387", "nice !!!")
if err != nil {
fmt.Println(err)
} else {
fmt.Println(string(res))
}
*/
/* user, err := insta.SelfUserFollowing("")
if err != nil {
fmt.Println(err)
}
fmt.Println("NextMaxID :", user.NextMaxID, "count :", len(user.Users))
for _, u := range user.Users {
fmt.Println(u.ID, u.Username)
}
*/
//res, _ := insta.SearchTags("#viral")
/* res, _ := //insta.TagFeed("funny")
insta.SelfUserFollowers("")
//insta.Timeline("")
for _, item := range res.Users {
//fmt.Println(item.Name, item.ID, item.MediaCount)
//fmt.Println(item.Caption.MediaID, time.Unix(item.TakenAt, 0), item.HasLiked, item.LikeCount)
fmt.Println(item.ID, item.Username, item.IsFavorite)
}
n := time.Now().Add(-180 * 24 * time.Hour)
res, _ := insta.UserFeed(1990837127, "", int64ToStr(n.Unix()))
for _, item := range res.Items {
fmt.Println(item.Caption.Text)
}
*/
}