WordPress.org

Ready to get started?Download WordPress

Forums

JSL3 Facebook Wall Feed
[resolved] Instagram photos missing from feed (7 posts)

  1. jamesee
    Member
    Posted 1 year ago #

    Heya Takanudo

    Awesome plugin. One thing - Instagram photos don't appear in the stream. I think this guy has figured out why: http://stackoverflow.com/questions/11677898/posts-from-instagram-not-showing-up-on-facebook-open-graph-api

    Any way you or I could fix this?

    Thanks!
    James.

    http://wordpress.org/extend/plugins/jsl3-facebook-wall-feed/

  2. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    Try this:

    1. Open '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-jsl3-facebook-wall-feed.php'
    2. Line 823 is the following:
      "scope=read_stream,offline_access,manage_pages,user_status&" .
    3. Change it to the following:
      "scope=user_actions:instapp,read_stream,offline_access,manage_pages,user_status&" .
    4. Save the file.
    5. Click "Save Changes" on the settings page for the plugin.
    6. You will be prompted to give your Facebook App permission to access your Instagram activity. Click "Allow".

    Let me know if this works.

  3. jamesee
    Member
    Posted 1 year ago #

    Yes - this works! Sort of...

    Now it will pickup Instagram photos only (no accompanying text) and only if I click "Show all status messages."

    Anyway to fine tune this behaviour?

    Thanks so much!
    James.

  4. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    I went ahead and installed Instagram on my phone and posted a photo to Facebook to test this out. Unfortunately, Facebook does not include the accompanying text in the feed.

    You can see this for yourself by going to https://developers.facebook.com/tools/explorer and entering you access token. In the other text box, enter "YOUR_FACEBOOK_ID/feed" (replace YOUR_FACEBOOK_ID with your actual Facebook ID). Then click "Submit". This will display your raw feed.

    As for showing up only when "Show all status messages" is checked, this is because the plugin assumes that any message that doesn't include a message, name, caption, or description is a status message. Changing this behavior would be more a little more complicated than the previous change that was made. Let me know if you want to proceed.

  5. jamesee
    Member
    Posted 1 year ago #

    Yes, I did have a play around with the feed. It does look a bit tricky to pull out Instagram photos with their descriptions. I think it will actually need to be a request to the album... What do you think?

    I'm happy to keep modifying code - I can just save it elsewhere in case the plugin is updated.

  6. Takanudo
    Member
    Plugin Author

    Posted 1 year ago #

    To separate Instagram posts from status messages, do the following:

    1. Open '/wp-content/plugins/jsl3-facebook-wall-feed/php/class-uki-facebook-wall-feed.php'
    2. Lines 494 to 497 are the following:

      if ( isset( $fb_feed[ $i ][ 'message' ] ) ||
      isset( $fb_feed[ $i ][ 'name' ] ) ||
      isset( $fb_feed[ $i ][ 'caption' ] ) ||
      isset( $fb_feed[ $i ][ 'description' ] ) )

    3. Change them to the following:

      if ( isset( $fb_feed[ $i ][ 'message' ] ) ||
      isset( $fb_feed[ $i ][ 'name' ] ) ||
      isset( $fb_feed[ $i ][ 'caption' ] ) ||
      isset( $fb_feed[ $i ][ 'description' ] ) ||
      ( isset( $fb_feed[ $i ][ 'application' ][ 'name' ] ) &&
      $fb_feed[ $i ][ 'application' ][ 'name'] == 'Instagram' ) )

    4. Save the file.

    As far as getting the descriptions, it may be possible to get them through an additional graph api call to the album or even the photo directly for each Instagram post. Unfortunately, I didn't have much luck. Besides, making an additional graph call for each Instagram post would slow down the plugin. I'm not sure it is worth it.

    However, if you find a method to do it, let me know and I'll help you modify the plugin if I can.

  7. jamesee
    Member
    Posted 1 year ago #

    Yes, you're right - I think that would get very complex very quickly, and would likely slow down the app.

    Thanks for your help, this all worked perfectly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic