Announcement Announcement Module
Collapse
No announcement yet.
Possible to upload a photo link to facebook wall ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Possible to upload a photo link to facebook wall ?

    I'm now trying to make a post to a Facebook wall that includes an UPLOADED image and a link.

    I know that its possible to post a url that will try to find a link for that image e.g.

    MultiValueMap<String, String> map = new LinkedMultiValueMap<String, String>();
    map.add("link", "http://www.google.com/");


    but thats no use to me..

    Anyone any ideas ?

    hopig you can help

    thanks

  • #2
    Well, you probably know you can post a link through the FeedOperations and upload a photo through the MediaOperations. Are you looking to create a single Post that contains both a link and an image?

    My initial response to this would have been to create a MultiValueMap<String, Object>, giving it a "link" and a "source" where "source" is a Resource to the image to be uploaded. But then I tried it and it didn't work. If I POSTed to my feed, it took it as a link without a photo and if I POSTed to my photos, it took it as a photo without a link.

    There may be another way...perhaps sending the image as the "icon" for the link. I've tried a few things and no luck so far.

    The nature of this question is more one of how you post a photo link using Facebook's Graph API and less of one involving Spring Social. Therefore, the way I'd approach this is to experiment using Facebook's API explorer (https://developers.facebook.com/tools/explorer) or the curl command line tool. Once you figure out what the request should look like, then you can try to recreate it using Spring Social's publish() method. If you figure out what the request should look like, but can't get it to work with Spring Social, let me know and I'll see if I can help you.

    Comment


    • #3
      If you are testing with a localhost address, Facebook has no way to scan the page to get the image. Once you put your code into production and the link you provide the FacebookLink object is a public url, the Image will show up without you having to do anything. Just use the connection.getApi().feedOperations.updateStatus(.. . method to post a link and Facebook will find the image on the page to display for you.

      Comment


      • #4
        yes, it took me a while to figure this out. Whatever link you post must be a link to page that has the following in the page header:

        <link rel="image_src" href="...../.xxx.jpg" />

        facebook looks for this header and when it finds it uses the image specified. This image shows up beside the link on the fb wall

        Comment

        Working...
        X