Refresh meta data in posted URL - facebook

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.

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.

Move facebook likes from one url to another

Over time I have built up a number of facebook likes on page = http://www.andy-howard.com/verticalAndHorizontalAlignment/index.html
But I need to convert this page to a php script (to be content manageable). Most likely it will be = http://www.andy-howard.com/code-help.php?id=143
Is there a way I can transfer my existing facebook likes to the new url?
You can’t transfer likes from one URL to another.
Only thing you can do, is make Facebook “believe” that the URL is still the old one – by setting the og:url meta tag in your new pages to the old URLs.
Facebook will use that value as the canoncial URL to identify this Open Graph object and to fetch the Open Graph information from, so you will have to see to it that those old URLs are
still available for the FB scraper to visit,
give it the OG info it is looking for, and
that “normal” visitors are redirected to the new URL, should Facebook link them to the old one
How to detect that the FB scraper is requesting your page, is described here: https://developers.facebook.com/docs/reference/plugins/like/#scraperinfo
I don't think there is a way to transfer likes from one url to another. Facebook like plugin is designed so that you can be on one page while actually liking completely other page (i.e. url). If that likes really matter, you can save the old url in database for each content and continue collecting likes for that url and just redirect visitors from that url to the new one.

Can an in-app object only be posted through an opengraph action?

I have a page inside a facebook application that is an opengraph object, when I post a custom action on this object to facebook from my app it is posted right, but when I use a facebook social plugin such as like and like that object it is not posted as that object but instead the object of my facebook application is posted on the timeline... so my question here is Can an in-app object only be posted through an opengraph action?
Nope, new OpenGraph object will be created or data will be updated for existing one once Facebook linter crawl your page to get data this will happen in several cases:
OpenGraph action referencing object published
Like button clicked for specific URL
Link to your page shared on Facebook (in direct way or via any dialogs using link, etc).
Your Like button is probably linked not to your real application URL but to URL within Facebook resulting in different Pages parsed by Facebook on Like Button click and OpenGraph action publishing.
I assume that your like button pointing to Application Tab Canvas or Application Page since links to regular application's canvas parsed correctly by Facebook.
Update:
Seems like the issue with OpenGraph tags is related to the fact that your application returning 404 (Not Found status code) for URL you provided and only returns data for HTTP (but not HTTPS) requests. If error code is returned the cached data is preserved and will not be updated until correct status code returned.
Update 2:
As you've provided real URL it's became clear that you get details for your application instead of actual page because of redirect for all unauthorized users, which lead to inability to rich the real OpenGraph data by Facebook linter.
BTW, You should be aware that every OpenGraph object MUST have publicly accessible URL.

How to force facebookexternalhit to reaccess?

I'm playing with facebook links via posting them. On the frist time a access from a user agent containing "facebookexternalhit" will visit your site and look for some meta tags.
So far so good that works. But if I try to repost the link no furure calls happens. How can I trigger to let facebook read the page again?
Are there some API calls I can use to trigger an update?
in the documentation for the Like Button it says:
When does Facebook scrape my page?
Facebook needs to scrape your page to know how to display it around
the site.
Facebook scrapes your page every 24 hours to ensure the properties are
up to date. The page is also scraped when an admin for the Open Graph
page clicks the Like button and when the URL is entered into the
Facebook URL Linter. Facebook observes cache headers on your URLs - it
will look at "Expires" and "Cache-Control" in order of preference.
However, even if you specify a longer time, Facebook will scrape your
page every 24 hours.
The user agent of the scraper is: "facebookexternalhit/1.1
(+http://www.facebook.com/externalhit_uatext.php)"
The Linter is now known as the Facebook Debugger and when you use it for a url, it will clear the facebook cache for the same url and will then cache the new result.
One trick you can use is to simply append a "random" GET parameter to the URL that you're sharing. It won't have any effect on the page's content, but will cause Facebook's scraper bot to reaccess your site.
Original URLs:
http://example.com
http://example.com?param=1
New URLs that will force a "reaccess":
http://example.com?cache_buster=784932789532
http://example.com?param=1&cache_buster=784932789532

Getting Open Graph og:image for page without being a page administrator

I want to use open graph to query the og:image and og:description value for a web page for which I am not an administrator.
I've tried using open graph and fql with both the id of the page and the url, but neither return that information.
I figured that since both values were "public" (they can be viewed in the source of the page) that they would also be public in OpenGraph.
Short of parsing the page myself, is this possible?
I took http://www.southparkstudios.com/ and checked the data returned by the Facebook Object Debugger and varified it had the description and image properties, then I simply clicked the Graph API url of the object (at the bottom of the page, Urls section) and received the site data, and it contained the image and description properties.
Based on that check, if you have the id of the web page then it should give you that info using the graph api, all you need is an active access token, even an application token will probably do the trick.
What did you get when you queried for that data? Did you get an error? just a smaller subset of the data?
Also, can you show the code of how you tried to get that data, both graph api and fql.