是否可以将图像从我的Web应用程序上传到instagram? [英] is it possible to upload images from my web application to instagram?
本文介绍了是否可以将图像从我的Web应用程序上传到instagram?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以将图像从我的Web应用程序上传到instagram ???
is it possible to upload images from my web application to instagram ???
如果是,那怎么办?
我已经尝试过以下代码.但我不知道如何上传图片?
i have tried this bellow code. but i dont khnow how to upload image ??
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());
}
如果有什么办法然后告诉我...
if there is any way then tell me...
请帮助我.
感谢...
推荐答案
没有办法实现.
http://instagram.com/developer/endpoints/media/
您只能通过其余媒体端点获取媒体.
You can only get media via rest media endpoints.
这篇关于是否可以将图像从我的Web应用程序上传到instagram?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文