1
1
2
2
# EasyInsta
3
- This is an android library through which you can use instagram programatically. You can say that this is a well optimize, will featured java wrapper of " Instagram graph API" . You can direct messages, add stories, post photos, scrapping profiles and can do many more things with this library.
3
+ An library through which you can use instagram programatically. You can say that this is a well optimize, will featured java wrapper of Instagram private API. You can send direct messages, add stories, post photos, scrap profiles and can do many more things with this library.
4
4
5
- ![ Banner] ( https://vinyl-state.com/wp-content/uploads/2020/12/instagram-logo2.jpg )
5
+ Disclaimer ⚠: This API is private. Means that instagram has not documented or allowed others to use this API. If you are using this API then instagram can ban your account. ** Developer will not be responsible for anything happend to your account** .
6
+
7
+ ![ Banner] ( https://i.ytimg.com/vi/jhTuFxpzevI/maxresdefault.jpg )
6
8
7
9
## Features
8
10
9
11
- Lightweight and Easy 2 use
10
12
- No need api token
11
13
- Supports ** sending direct message** (Text & photos)
14
+ - Supports ** Login using proxy**
12
15
- Supports ** posting** (Only photo)
13
16
- Supports ** adding stories** (Only photo)
14
17
- Supports ** Following / Unfollowing others**
@@ -28,7 +31,7 @@ This is an android library through which you can use instagram programatically.
28
31
In your app build.gradle
29
32
``` groovy
30
33
dependencies {
31
- implementation 'com.github.ErrorxCode:EasyInsta:2 .0'
34
+ implementation 'com.github.ErrorxCode:EasyInsta:v2 .0'
32
35
}
33
36
```
34
37
@@ -43,7 +46,7 @@ dependencies {
43
46
## API Reference
44
47
45
48
#### Create instagram object by logging in.
46
- ```
49
+ ``` java
47
50
try {
48
51
Instagram insta = new Instagram (" username" ," password" );
49
52
} catch (IGLoginException e) {
59
62
```
60
63
61
64
#### Two factor login
62
- ```
65
+ ``` java
63
66
Instagram instagram = Instagram . login2factor(" username" , " password" , new Callable<String > () {
64
67
@Override
65
68
public String call () throws Exception {
@@ -81,7 +84,7 @@ login.setOnClickListener(new View.OnClickListener() {
81
84
82
85
Each method returns a ` Task ` representing the response of the request. The resoponse either contain a value or an exception
83
86
depending upon success and failure. You can use the task in 2 ways. Ony way is,
84
- ```
87
+ ``` java
85
88
task. addOnCompleteListener(new Task .OnCompletionListener<String > () {
86
89
@Override
87
90
public void onComplete (Task<String > task ) {
@@ -93,8 +96,8 @@ task.addOnCompleteListener(new Task.OnCompletionListener<String>() {
93
96
}
94
97
});
95
98
```
96
- another way is
97
- ```
99
+ another way is,
100
+ ``` java
98
101
task. addOnSuccessListener(new Task .OnSuccessListener<String > () {
99
102
@Override
100
103
public void onSuccess (String value ) {
@@ -109,44 +112,64 @@ task.addOnSuccessListener(new Task.OnSuccessListener<String>() {
109
112
```
110
113
111
114
#### Now let's post something...
112
- ```
115
+ ``` java
113
116
Task<String > task = instagram. addStory(new File (" story.png" ));
114
117
Task<String task = instagram. postPhoto(new File (" post.png" )," This is caption" );
115
118
```
116
119
117
120
#### Send direct message
118
- ```
119
- instagram.directMessage("x__coder__x","This is message...",null );
120
- instagram.directMessage("x__coder__x",new File("photo.jpg"),callback );
121
+ ``` java
122
+ Task< String > task = instagram. directMessage(" x__coder__x" ," This is message..." );
123
+ Task< String > task = instagram. directMessage(" x__coder__x" ,new File (" photo.jpg" ));
121
124
```
122
125
123
126
#### Follow / Unfollow / remove someone
124
- ```
125
- insta .follow("username2follow",callback );
126
- insta .unfollow("username2unfollow",callback );
127
- insta .removeFollower("username2remove",callback );
127
+ ``` java
128
+ instagram . follow(" username2follow" );
129
+ instagram . unfollow(" username2unfollow" );
130
+ instagram . removeFollower(" username2remove" );
128
131
129
132
```
130
133
131
134
#### Accept or ignore follow request
132
- ```
133
- insta .accept("username2accept",null );
134
- insta .ignore("username2ignore",null );
135
+ ``` java
136
+ instagram . accept(" username2accept" );
137
+ instagram . ignore(" username2ignore" );
135
138
```
136
139
137
140
#### Get followings / followers / counts
138
- ```
139
- List<String> followers = insta .getFollowers("username",callback );
140
- List<String> followings = insta .getFollowings("username",callback );
141
- int followersCount = insta .getFollowersCount("username",null );
142
- int followingCount = insta .getFollowingsCount("username",null );
143
- int postCount = insta .getPostCount("username",callback );
141
+ ``` java
142
+ Task< List<String > > followersTask = instagram . getFollowers(" username" );
143
+ Task< List<String > > followingTask = instagram . getFollowings(" username" );
144
+ Task< List< Integer > > followersCountTask = instagram . getFollowersCount(" username" );
145
+ Task< List< Integer > > followingsCountTask = instagram . getFollowingsCount(" username" );
146
+ Task< List< Integer > > postCountTask = instagram . getPostCount(" username" );
144
147
```
145
148
146
149
#### Get profile metadata
147
- ```
148
- String bio = insta.getBio("username",callback);
149
- String url = insta.getProfilePicUrl("username",callback);
150
+ ``` java
151
+ instagram. getBio(" username" ). addOnCompleteListener(new Task .OnCompletionListener<String > () {
152
+ @Override
153
+ public void onComplete (Task<String > task ) {
154
+ String bio;
155
+ if (task. isSuccessful())
156
+ bio = task. getValue();
157
+ else
158
+ task. getException(). printStackTrace();
159
+ }
160
+ });
161
+
162
+ instagram. getProfilePicUrl(" username" ). addOnSuccessListener(new Task .OnSuccessListener<String > () {
163
+ @Override
164
+ public void onSuccess (String value ) {
165
+ String url = value;
166
+ }
167
+ }). addOnFailureListener(new Task .OnFailureListener () {
168
+ @Override
169
+ public void onFailed (Throwable exception ) {
170
+ exception. printStackTrace();
171
+ }
172
+ });
150
173
```
151
174
## Documentation
152
175
@@ -157,21 +180,16 @@ String url = insta.getProfilePicUrl("username",callback);
157
180
158
181
#### [ Q.1] Can we use this library to make bots ?
159
182
160
- Answer. No. Instagram don't allow to make bots with the use of this APIs.
183
+ Answer. No. Instagram don't allow to make bots with the use of APIs.
161
184
162
- #### [ Q.2] Can we use this to download stories or posts ?
185
+ #### [ Q.2] Can we download stories or posts using this API ?
163
186
164
- Answer. Yes. But its not currently supported .
187
+ Answer. No, Not currently. May be possible in future .
165
188
166
- #### [ Q.3] Does use of this library requires any tokens or other things ?
189
+ #### [ Q.3] Does use of this library requires any tokens or other keys ?
167
190
168
191
Answer. No. You only need to have username and password of the account.
169
192
170
- #### [ Q.4] Can we log in two-factor-authenticated accounts ?
171
-
172
- Answer. Yes. Just pass a callback as thired argument while initializing the class.
173
-
174
-
175
193
176
194
## Contributing
177
195
0 commit comments