Opengraph og:image unable to change URL - facebook-graph-api

We have a problem when users update the og:image for an article.
The Open Graph Debugger picks up the new image, and our CMS triggers a scrape using the API endpoint documented here.
But for existing shares, Facebook renders a placeholder and doesn't update to the new og:image URL. Which means if the original image is deleted in our CMS, Facebook shows a blank placeholder:
Facebook's documentation says:
You can always edit an object's properties, with two exceptions:
Title: Once 50 actions (likes, shares and comments) have been associated with an object, you won't be able to update its title
Type: An object's type can't be changed once it's been used in a story
If you want to update an image for an object, we strongly suggest that the URL to the image be different than the original image URL. Caching may prevent the image from being updated.
Images uploaded to our CMS always have unique filenames, and are served from an Amazon S3 bucket via Cloudflare.
If we don't delete the original image from our server, in existing shares Facebook continues to use the original in spite of the og:image changing and us telling FB to re-scrape the URL.
How can we get the image to update?
Twitter and Linkedin do not have a problem as they appear to cache the original image on their servers, so once we delete the file they continue to serve the original og:image. That's fine - but Facebook needs to show an image.

Try ?v=2 at the end of og:image url.

Related

Is it necessary to create pages with the recent changes to the Facebook like button?

I was reading over the changes to the Facebook Like button that are scheduled to take place in November 2012, and I'm a bit confused (and hoping someone has an answer).
I understand that the REST endpoints are being removed in favour of regular pages, but here's where I'm confused.
Previously, if I did the following...
Create a page
Add the correct OpenGraph metatags to the page
'Like' the page
... Then an OpenGraph object would be created automatically (and could be verified by visiting http://graph.facebook.com/?id=my_url). If I published to that OpenGraph object, people would receive updates.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created? Or it is created, but I still need to create a Facebook page to administer and send messages?
Any help would be appreciated.
However, with the changes, if I understand them correctly, the OpenGraph object is no longer created?
That phrasing is a little besides the point.
You create the Open Graph object, by setting up a page with appropriate OG meta tags.
And Facebook will count likes for this URL, like for every other URL.
Or it is created, but I still need to create a Facebook page to administer and send messages?
No admin pages will be created automatically any more; although you can convert existing ones to normal public Facebook pages. But then you have to point the like button to the URL of that new Facebook page instead of your OG URL to be able to publish updates to your fans. (So this will behave basically like a normal Facebook page that was set up to be one in the first place; only this step allows you to “migrate” your existing likers for your OG URL to that page, so you don’t need to have a “fresh start” with your Facebook page.)
The document further describes, what to do if you still need the ability to publish updates to the users liking your OG URL – by providing fb:app_id and fb:admins meta tags:
“This will ensure that the Like Button admin link still appears on the given Open Graph page. The admin page for a given Like Button is also accessible to administrators from https://www.facebook.com/bookmarks/pages”
But publishing updates this way will only work until the Like Button admin page is fully deprecated. From then on, you will have to use a Facebook page, if you want to be able to publish updates to the users who liked your page.

Unable to publish to facebook feed

I operate a website, http://www.plingo.com.br/
I have created a like button for that webpage, as well as specified opengraph tags that point back to the same URL and included a video.
I have set the og:type tag to 'blog'.
When someone clicks Like, the video and URL get posted to the users feed as expected.
However, my issue revolves around being able to publish to users of my feed.
As you can see in my opengraph tags, I have associated my URL to a facebook application that I own.
I have followed the instructions at developers.facebook.com/docs/opengraph/ on how to publish to my feed directly, however when I run the PHP script, I receive this error:
"error": {
"message": "(#100) (the url) does not resolve to a valid user ID",
"type": "OAuthException"
}
However, the opengraph at the URL points both to my facebook account as well as my application.
I have no idea why I am unable to do this.
However, to try to diagnose the issue, I made a similar webpage at http://www.plingo.com.br/ogtest.php and set all the attributes of the opengraph tags the same, except for the og:url and the youtube video. Running the publish script using that URL however, works fine, and facebook even generated an administrative page for publishing to facebook.
I am wondering why this is not working with my root URL. Is there any way to get Facebook to give me an Administrative Page? Why can't I publish, even though I have associated the opengraph IDs properly?
I would GREATLY appreciate any input as I have tried countless different things, changes, etc to see where the issue lies.
Thank you

Facebook like button - how to prevent activity stream from getting into the user's wall?

Can someone please help me out as to how I can completely prevent the user's activity stream from posting back into their wall after they liked a linked? Because, I really find that to be annoying. Afterall, mine is an application that needs to be integrated into an image gallery viewer serving more than 7.5K photos each with its own like button.
If this seems impossible, is there a way to specifically set an image as thumbnail, description, etc as is with the cases of feed and send buttons?
Because, my application is purely dynamic in nature built out of 100% Javascript where more than 80% of its contents are generated by using Ajax calls under a static single URL.
As a result, the like button activity stream always end up pulling the wrong image and descriptions than desired(but this is not so for feed and send buttons),
Thank you
No, you won't have control over not sending items to peoples activity feeds when they click like, unless your domain gets blocked for spam. You would need to create a dynamic url or hashbang url for each independent image and when those images are requested the page hosting it would need to have the proper open graph meta tags sets for thumbnail image, description, etc. Then for each like button in the gallery, you would need to set the href property to this url.

me/feed with pic from different domain

I was trying to find this on facebook's site in their documentation but so far no luck. I'm sure others must have run into this before.
I use Amazon S3 for storing images. I didn't know ahead of time that if I named my bucket as my domain name with subdomain I could link that way, so until I move all of the pictures I have to link to mybucket.s3.amazonaws.com domain. When I include a picture from there with a post to the wall the picture doesn't show up. If I change the picture to one on the server itself the picture does show up. It seems that the domain name of the picture must match my app? I looked at bugzilla and didn't see this mentioned. Facebook's forum says to post questions here.
I'm using the C# Facebook SDK from CodePlex.
My code looks like (with error handling and authentication check removed):
var client = new FacebookClient(FACEBOOK_APP_ID, FACEBOOK_SECRET);
client.AccessToken = facebook.AccessToken;
var parameters = new Dictionary<string, object>();
parameters.Add("name", name);
parameters.Add("caption", title);
parameters.Add("message", message);
parameters.Add("link", link);
parameters.Add("source", link);
parameters.Add("picture", imageUrl);
client.Post("me/feed", parameters);
I verified that imageUrl does indeed have a correct picture, the domain name just doesn't match. The picture on amazon s3 has public read access. I can view it from my browser so I don't think it's a permission problem. I've tried a few different pictures with the same problem. Only time it's worked so far is when the picture was on the server itself.
So, my question is, is it a problem with me, or does facebook block images that don't match the domain name specified on the app?
You can upload the picture from that url, then add its object id in the post.
Refer to: http://developers.facebook.com/blog/post/526/?ref=nf
Uploading Photos to the Graph API via a URL
Earlier this year, we released support for uploading photos directly
via the Graph API. This requires sending the photo as a MIME-encoded
form field. We are now enhancing our photo upload capability by
introducing the ability to upload photos simply by providing a URL to
the image. This simplifies photo management for a number of use cases:
App developers who host their images on Amazon S3 or a similar
service can pass the S3 URL directly to Facebook without having to
download the file to their application servers only to upload it
again to Facebook. This improves performance and reduces costs for
developers.
Apps written on platforms that don't have good support for
multipart file uploads can create new photos more easily.
To upload a photo via a URL, simply issue an HTTP POST to
ALBUM_ID/photos with the url field set to the URL of the photo you
wish to upload. You need the publish_stream permission to perform this
operation. You can also include an optional message parameter to set a
caption for the photo.
I'am facing the same issue as well. Based on my observations it seems that facebook does not like it when the picture url has more than one sub-domain.
I tried the below 2 URL variations for the same image..
mybucket.s3.amazonaws.com - throws an error
s3.amazonaws.com/mybucket - works fine
:picture => 'http://mybucket.s3.amazonaws.com/footprints/15/coverimgs/medium.jpg'
OAuthException: (#100) picture URL is not properly formatted
:picture => 'http://s3.amazonaws.com/mybucket/footprints/15/coverimgs/medium.jpg'
{"id"=>"587472956_10150280873767957"}
Now i have to figure out how to change the URL structure for the image while passing it to the FB graph API.
I would log it as a bug. If this is really the case, which I kinda doubt, you could create a 301 redirect on your own domain for each image that redirects to the Amazon url.

Django - Preview uploaded picture prior to deciding to save

Like the title suggested, I want to implement a two-steps picture uploading mechanism.
User selects a picture to upload and
click on "Upload". Once the server
receives the request that contains
the picture, it would save the
picture in a temporary location, on
disk or memory, and the resize it to
a standard size, if needed. The
server then renders a new response
for the user to preview the uploaded
picture.
After previewing the picture, the user needs to click on "Save" to confirm for the server. The server then moves the picture from the temporary location to a permanent one and updates the corresponding entry in the DB.
What's a good way to implement this? What are some of the apps out there that might be able to help me? Thanks.
I would suggest either rolling your own (you might find it surprisingly easy, start with reading the docs on forms) or customizing django-photologue or django-filebrowser.