是否可以将我的网络应用程序中的图像上传到Instagram ???
如果是,那么如何?
我试过这个波纹管代码。但我不知道如何上传图片??
String clientId = "XXXXXx";
String clientSecret = "XXXXXXX";
String callbackUrl = "http://xxxx.com/InstaGram/Auth";
InstagramService service = new InstagramAuthService().apiKey(clientId).apiSecret(clientSecret).callback(callbackUrl).scope("comments").build();
String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);
System.out.println("** Instagram Authorization ** \n\n");
System.out.println("Copy & Paste the below Authorization URL in your browser...");
System.out.println("Authorization URL : " + authorizationUrl);
Scanner sc = new Scanner(System.in);
String verifierCode;
System.out.print("Your Verifier Code : ");
verifierCode = sc.next();
System.out.println();
Verifier verifier = new Verifier(verifierCode);
Token token = service.getAccessToken(EMPTY_TOKEN, verifier);
System.out.println("Token : " + token.getToken());
String accessToken = "7073519.44e6baf.d44336e2e99741f6a5bed94b26f1699c";
Token secretToken = new Token(accessToken, null);
Instagram instagram = new Instagram(secretToken);
UserInfo userInfo = instagram.getCurrentUserInfo();
MediaFeed mediaFeed = instagram.getRecentMediaFeed(userInfo.getData().getId());
// MediaFeed mediaFeed = instagram.getUserFeeds();
List<MediaFeedData> mediaList = mediaFeed.getData();
for (MediaFeedData data : mediaList) {
System.out.println("data : " + data.getId());
//instagram.setMediaComments(data.getId(), "Comment was created at " + new Date().toString());
}
System.out.println("***** User Info ******");
System.out.println("Username : " + userInfo.getData());
}
如果有什么办法告诉我......
请帮助我..
...感谢名单