1
votes

I have the following snippet to post to a user's feed on Facebook:

require 'httparty'

token = "..."
message = "..."
url = URI.escape("https://graph.facebook.com/me/feed?access_token=#{token}")
response = HTTParty.post(url, body: { message: message })

This posts to the wall, but no message is included. Any ideas what's wrong?

Edit:

I tried changing out the message for a caption or description and both failed as well.

2
Facebook plans to deprecate the message on July 12th, 2011. I know the date hasn't past yet but looking for an alternative is hopefully useful like description or caption. - xanderer
@xanderer I tried switching the form post to use a caption and a description and both failed. Any other ideas? - Kevin Sylvestre
I usually use Javascript SDK to post to wall, but have you tried appending it to the query string as seen here - xanderer

2 Answers

1
votes

Solution is to change HTTParty from using body to query for posting form data:

require 'httparty'

token = "..."
message = "..."
url = URI.escape("https://graph.facebook.com/me/feed?access_token=#{token}")
response = HTTParty.post(url, query: { message: message })
1
votes

Based on the link cited above, it appears message functionality has been completely removed from the feed connection since July 12.

This is a problem for my current app as it is specifically a public opinion site. Asking users to express their opinions authentically is an important part of our design and we'd like to give them the option to post that to their feeds on Facebook as well.

Per the Facebook terms of use IV.2, "You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow." The new change appears to change the terms of service: in my use, I am specifically asking the user to generate the content earlier in the workflow, but I still can't use it to pre-fill the feed dialog.

Anyone have any ideas or insight?