JInstagram - How to establish a connection?

I want to create a live based Java application showing specific Instagram photos tagged with a specific hashtag. I am currently trying to use jInstagram, but I cannot understand Instagram API thread. This is not like the Twitter API. The Instagram API seems to be calling the server in the middle of my application and their servers, and the Twitter API gives me access to the garden house without much work. And overall, thanks to the good samples on Twitter4J.org

I would be grateful if anyone would help me get started. I just want to get live photos with a specific Instagram hashtag, but I don’t know if I have to configure the server or where it gives me the access token.

+3
source share
1 answer

- instagram apiKey apiSecret. URL- .

InstagramService service = new InstagramAuthService()
                .apiKey("e607b7XXXce54e729bXXXXf40162")
                .apiSecret("651cXXX2ab348a3XXXXa7ae90c6d")
                .callback("http://www.cagdasalagoz.com")
                .scope("basic public_content likes comments follower_list relationships")
                .build();

.

    String authorizationUrl = service.getAuthorizationUrl();

    System.out.println(authorizationUrl); //paste in browser

    Scanner sc = new Scanner(System.in);

    System.out.println("Paste the code gotten in the browser (at the end of the URL):  ");
    String verCode = sc.nextLine();  //SCAN VERIFIER CODE

    Verifier verifier = new Verifier(verCode);

    Token accessToken = service.getAccessToken(verifier);  //Token successfully gotten

    //** RUNS OK UP TO THIS LINE INCLUDED **//
    Instagram instagram = new Instagram(accessToken);   //Ok

, .

String tag="seaside";
instagram.getRecentMediaFeedTags(tag);

jInstagram .

+2

All Articles