Updating existing timeline posts using Facebook's Open Graph API - facebook

Is a POST to graph.facebook.com/?id={id}&scrape=true (as documented here) supposed to expire cache and update already-published timeline data immediately?
I have noticed in my case that when I update an og:image value for an Open Graph object page, enter the object's URL in the Facebook Debugger and then refresh my friend's Facebook timeline, I see the updated og:image immediately.
However, I do not see existing timeline open graph action publishes updated when using the graph.facebook.com/?id={id}&scrape=true method. It seems like my POST to scrape is not working, but the response I get is a JSON with all the updated data I expect.
I also notice that any new timeline posts for the same object have the new og:image referenced immediately, so it seems like the scrape is working - but not updating existing posts. Is there a way to force existing timeline posts to be updated as well, or is that working for others?
Thanks in advance

After a bit more research, I seemed to have a race condition issue here. Adding a delay to force the Facebook post a few seconds after persisting object changes fixed the issue for me.

Related

Is there any API for fetching metadata of article using Facebook Open Graph Object Debugger?

I want to fetch metadata of any web-page using Facebook Open Graph Object Debugger.
We can get it from this URL: Open Graph Object Debugger
Example: Open Graph Object Debugger for Google
It will provide all the information related to that URL. Is there any way to get this information using API(in JSON format)?
Yes, via the API URL Object described here and in even more detail here. Note that you can issue a POST request to this URL to force a refresh. You can even get additional data such as how many times that link was shared on Facebook!
https://graph.facebook.com/v2.10/?fields=og_object&id=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt2015381%2F&access_token={YOUR_TOKEN}
I did experience inconsistencies, namely if the obejct does not exist the API will return nothing but if you query it a few seconds later it will be there. For this reason we could not rely on Facebook and simply fetched the page ourselves and parsed out the og:* tags.
It may be perfect if you don't care about misses and having to re-fetch or if you just want to programmatically clear the Facebook OG cache.
It's wise to post to it every time you create a new page to force the cache or sometimes the first person to paste the URL into Facebook won't get the link preview!
Yes you can use this https://urlmeta.org
Its usage is pretty simple. Just make a GET call and pass the URL to API endpoint: https://api.urlmeta.org and you are done.

Having issue with Facebook debugger not scraping new data

I've updated my Meta Description in WordPress (using SEO by Yoast), but Facebook continues to use old data. This is after using the debugger. Any suggestions?
If you are referring to the OpenGraph tags, once facebook scans a value and logs it you can't update it without changing the values. I ran into a similar issue before. If you Google search some you'll find explanations from Facebook Support on the matter.
Even running the 'Scrape new data' or whatever the action is it will inform you that you are trying to change xxxxxx value. After my research I ended up changing the meta property value with an extension on the url and Facebook scraped the data and updated it correctly. However all of the page likes were lost in this process.

facebook opengraph not updating and other questions

I'm having a problem using Facebook's OpenGraph. I'm attempting to implement timeline features into my application. However, when try changing my meta tags to change the tile of my object, the changes are not reflected. When I pass my url into the debugger tool facebook offers, it displays that my OG object is still using the old data, as opposed to the new data. However, the weird thing is the raw properties show my changes. How do I get facebook to update the OG object?
Another problem I'm having is that when I make changes to my actions, facebook isn't properly updating it. When I reopen the action, it's still referencing my old object titles. For example, if a title of one of my movie objects was "sci fi," and I reference "sci fi" in the action "see," it will still be referencing "sci fi" even if I try to change it to something else. I would save and it, but when I reopened the action the old settings where still there.
I was also wondering about dynamic generation of objects. For example, if I had an app that allowed people to list movies they've watched, could I dynamically generate the OG object so that users can have the "see a $movie" show up in their timeline no matter what movie it was? The reason I'm wondering is because right now I'm unsure whether or not I need to keep the page with the meta tags up after I use it once.
Sorry for the word blocks and if my questions seem basic to you. I'm pretty much a newbie at this.
Putting your URL into the Object Debugger should force Facebook to crawl it. Do you have your og:url pointing to the old URL?
I don't understand your second question. Is Facebook not crawling your page? It should recrawl every 7 days or you can force it with the scrape API.
For your third question, yes, you can do that. Just make a different URL for each movie with a different og:url. For good SEO you want to do example.com/movie/1234/The-Matrix.
http://developers.facebook.com/tools/debug
Try this and put the link of the page you want facebook to clear its cache for.

Refresh meta data in posted URL

In Facebook, when I post the link http://wisdomuniversity.org, Fascebook includes old metadata (Title, description, etc.). I recently added Open Graph Protocol meta tags, but Facebook still uses the old stuff. How does Facebook refresh this metadata and can I force a refresh?
You need to ping facebook and notify them to update changes and to do that you can use
URL Linter. It may take some time for facebook to update your changes. I'm not sure how much time they take to update after pinging, but just try it.
EDIT: This is officially from facebook: Open Graph protocol
Editing Meta Tags
You can update the attributes of your page by updating your page's
tags. Note that og:title and og:type are only editable
initially - after your page receives 50 likes the title becomes fixed,
and after your page receives 10,000 likes the type becomes fixed.
These properties are fixed to avoid surprising users who have liked
the page already. Changing the title or type tags after these limits
are reached does nothing, your page retains the original title and
type.
For the changes to be reflected on Facebook, you must force your page
to be scraped. The page is scraped when an admin for the page clicks
the Like button or when the URL is entered into the Facebook URL
Linter. You can programmatically force your page to be scraped by
cURL'ing the linter. For example:
curl
> https://developers.facebook.com/tools/lint/?url={YOUR_URL}&format=json
Use Facebook debbugger and detect the problems related to og FB metadata, https://developers.facebook.com/tools/debug/. Then, if Fb says your image is too small, pull a bigger image and use odd width for the image e.g. 300px, 500px etc. It seems when FB doesn't find the correct image size, title or description, trends to grab main site metadata.
You can update your Open Graph object information but just sending a CURL request, like documented here: https://developers.facebook.com/docs/sharing/opengraph/using-objects
POST https://graph.facebook.com/?id={object-instance-id or object-url}&scrape=true
I hope this helps...
Tool URL has changed to https://developers.facebook.com/tools/debug. Now GET request should be sent to: https://developers.facebook.com/tools/debug/og/object?q={YOUR_URL}.
If you are getting an error "Error parsing input URL, no data was scraped." try to add following header to a request: Referrer: https://developers.facebook.com
As of the end of 2016, the way to programmatically notify Facebook of changes in your URL and have it scrape it again is by submitting a POST to this URL:
https://graph.facebook.com/?id={YOUR_URL}&scrape=true
Earlier ways, some noted on this page, have been deprecated. This is documented here:
The Facebook crawler will re-scrape (and therefore update) objects:
When the object URL is input in the Object Debugger Every 30 days
after the first scrape When an app triggers a scrape using an API
endpoint This Graph API endpoint is simply a call to:
POST /?id={object-instance-id or object-url}&scrape=true
The response from this endpoint will be a JSON object that contains all the
information about the object that was scraped (the same data returned
when the Object ID is read from the Graph API).
The id parameter can be either the canonical URL of your object or the
ID of the object instance in the graph.

Facebook stopped pulling metadata for certain blog posts despite all posts using the same PHP template

I'm currently using Drupal 6 with a special content type template for all blog posts. At the moment we're not using OG tags but I have it pull the main metadata with content-type, title, image, and description tags and it was working just fine until today.
Despite at least the last 3 posts still displaying properly in URL Linter, the newest for today won't pull any of the metadata. A few other ones I tested at random from the archive aren't pulling information properly either, but the majority are still working.
What would cause a discrepancy in Facebook's URL Linter between pages using the same template?
What is the url? Are the tags in the header? Are you able to test switching to their new OG open graph tags? Facebook has been known to deprecate old functionality with little to no warning - and perhaps the old url's are working still because Facebook has already cached the data. It looks like a lot of people are having this same issue - and I am assuming Facebook will fix it soon if it isn't already fixed.