Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dipanwita das 19 posts 100 karma points
    Jan 18, 2019 @ 09:57
    dipanwita das
    0

    Skybrud.Social.Instagram help

    Hi,

    I'm new to umbraco and also to SkyBrud.Social. After setting up the instagram in my project, i am facing issue in instagram partial view page:

    var instagram = rootNode.GetPropertyValue

    This instagram is always null. I tried including "\App_Plugins\Skybrud.Social" into the project and i am getting compile time errors . Should it be included in the project ??

    So can you help me with this ??

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jan 18, 2019 @ 10:21
    Ismail Mayat
    0

    instagram changed their api you can no longer get data through skybrud social see https://social.skybrud.dk/instagram/

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Jan 18, 2019 @ 10:45
    Anders Bjerner
    0

    Parts of the old Instagram Platform API actually still works - eg. getting the recent media of the Instagram user authenticated through this package.

    The folder /App_Plugins/Skybrud.Social/ contains resource that are used in the backoffice. You'll need these to authenticate with your Instagram user the backoffice, but these files are not required in the frontend.

    You provide the line below:

    var instagram = rootNode.GetPropertyValue
    

    I can't really see what's going on here. Can you share some more of your code? You also write that you're getting compile time errors - could you share these as well?

    If your code contains sensitive information, make sure to blank it out before posting it here. I just need to get a general idea of your code, and what's going wrong ;)

  • dipanwita das 19 posts 100 karma points
    Jan 22, 2019 @ 12:32
    dipanwita das
    0

    Hi Andres,

    I have given you the information regarding my issue. And i am waiting for your reply. As the issue is an urgent requirement.

    Do let me know.

    Thanks,

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Jan 22, 2019 @ 21:48
    Anders Bjerner
    0

    I'm still not sure of the error you're seeing. The stack trace of the error contains helpful information - without that it's hard for me to help.

    You write that the instagram variable is null - is this what triggers the compile errors? You've only posted parts of the line that reads the property value, so again, I can't really see what's going on.

    There are a few reasons why the property value would be null:

    • The property is added on another page than the one you're trying to read it from
    • You're trying to read from a property using the wrong alias
    • You haven't authenticated with Instagram, thus the property value is empty

    There could be more reasons - these were the first can came to my mind.

    Another thing - as Ismail mentioned, Instagram has made some changes to the API, so the sample you're using is also a bit outdated. This isn't related to the error you're describing now, but you will probably get some other errors along the way, as Instagram has removed most methods from their API.

    The change in Instagram's API means that you're no longer to request information about or recent media of a specific user - now you'll only be able to do this for the authenticated user.

    Based on the code you posted, is should look something like:

    if (instagram != null && instagram.IsValid) {
    
        // Gets an instance of InstagramService based on the OAuth data
        InstagramService service = instagram.GetService();
    
        // Get recent media from the authenticated user
        InstagramRecentMediaResponse recent = Model.Users.GetRecentMedia(new InstagramUserRecentMediaOptions {
            Count = 33
        });
    
        <fieldset>
            @foreach (InstagramMedia media in recent.Body.Data) {
            <a href="@Umbraco.Field("instagramSocial")"><img src="@media.Thumbnail" alt="@media.CaptionText" height="110px" width="110px" /></a>
            }
        </fieldset>
    
    }
    
  • dipanwita das 19 posts 100 karma points
    Feb 07, 2019 @ 08:40
    dipanwita das
    0

    Hi Andres,

    Thanks for the help in instagram. I fetched the recent posts from instagram in my application and it was perfectly working fine one day before and i tested it several times and after that i didn't made any changes regarding instagram in my backoffice nor in my code. But today when i try to run my application i get no instagram. When i checked the condition for instagram , i found that the instagram is passing null. whereas i authorized instagram in content section where it is working fine.

    Please help .

    Regards, Dipanwita

  • dipanwita das 19 posts 100 karma points
    Jan 18, 2019 @ 11:09
    dipanwita das
    0

    Hi,

    I followed Owain Williams post from old thread (https://our.umbraco.com/packages/website-utilities/skybrudsocial-for-umbraco-7/general-discussion/65368-Instagram-help#comment-301001) and created instagram.

    After that the instagram is always null and this is the following code :

    if (instagram != null && instagram.IsValid) {

        // Gets an instance of InstagramService based on the OAuth data
        InstagramService service = instagram.GetService();
    
        // Gets information about the authenticated user
        InstagramUserResponse self = service.Users.GetSelf();
    
        // Get recent media from the authenticated user
        InstagramRecentMediaResponse recent = service.Users.GetRecentMedia(self.Body.Data.Id, 4);
    
    
    
        <fieldset>
            @foreach (InstagramMedia media in recent.Body.Data) {
            <a href="@Umbraco.Field("instagramSocial")"><img src="@media.Thumbnail" alt="@media.CaptionText" height="110px" width="110px" /></a>
            }
        </fieldset>
    
    }
    

    this is the code i have used . Please help !!

  • dipanwita das 19 posts 100 karma points
    Jan 18, 2019 @ 11:35
    dipanwita das
    0

    Hi ,

    For the information, the version of umbraco i am using is 7.10.4.

Please Sign in or register to post replies

Write your reply to:

Draft