Facebook debugger is caching meta data for an old IP address - facebook

When I try and scrape my URL, http://development.classroom.me.uk, with the Facebook debugger at https://developers.facebook.com/tools/debug, I get back information for an older version of the website on an IP address that is no longer hosting this site.
The original IP was 46.32.233.216, but the new IP is 212.67.215.188.
I have another website running on the new IP:
http://advert.classroom.me.uk
This website gets scraped without any issues, so this is not a firewall problem.
Facebook is caching the domain http://development.classroom.me.uk with the old IP, which is why the scraper is returning a 502 [bad gateway] response. It is retrieving out of date data, but unable to actually return the URL:
Go to http://development.classroom.me.uk, and view source.
In the document head, you will see:
<meta property="og:title" content="classroom" />
<meta property="og:description" content="classroom provides a digital communication platform for teachers and students" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://development.classroom.me.uk/images/logo/logo-facebook.png" />
<meta property="og:url" content="http://development.classroom.me.uk" />
Go to https://developers.facebook.com/tools/debug, and type in http://development.classroom.me.uk into the input field. Press 'Debug'
I would expect to see information about the Facebook meta tags provided above.
I actually see data from an old version of this website held on an IP address that no longer hosts this site. In fact the old website contains no Facebook meta tags at all, which is why you can see data being scraped from the HTML title & standard meta description tag, instead...
Can anyone provide a solution for how I can clear the Facebook proxy cache. I have tried submitting this issue several times on Facebook, but no one from Facebook has provided me with a proper solution...
Thanks in advance

OK. With the help of the Facebook IT Department, we got to the bottom of this one. Indeed, the data was being cached. This was not a firewall issue, as I suspected, even though I was told repeatedly that it was.
I placed a new index page up at http://development.classroom.me.uk on my new IP 212.67.215.188
The page contained an HTML skeleton. See below [note, I placed no data in the document body]:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="keywords" content="classroom, home, yoga, indian head massage, tai chi, feng shui, united kingdom, therapy" />
<meta name="description" content="classroom provides a digital communication platform for teachers and students" />
<meta name="robots" content="index, follow" />
<meta property="og:title" content="classroom" />
<meta property="og:description" content="classroom provides a digital communication platform for teachers and students" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://development.classroom.me.uk/images/logo/logo-facebook.png" />
<meta property="og:url" content="http://development.classroom.me.uk" />
<title>classroom</title>
</head>
<body>
</body>
</html>
I then used the Facebook debugger at https://developers.facebook.com/tools/debug to scrape this address again. Voila. The page returned a 200 response & the correct meta data.
The cache has been cleared.
Unfortunately, when I returned the correct index page back to http://development.classroom.me.uk, I still get a 502 response from the Facebook debugger. However, the important thing, is that the correct meta data & image remain.
I am going to try and work out why I am getting the 502 response, and when I do, I will let you know. I thought I would write up the answer now, as I know several developers have been troubled by this issue..

Related

Open Graph Facebook _ NextJS app : all my metadata appears on the page view source but Facebook complain that it found nothing

I have all my metadata in my NextJS app, they are put on the root page, so the metatada appear well on my view source's page. But my Facebook open graph seems to don't reach them for an unknown reason to me.
Here my ReactJS:
<Head>
<title> Test 02 </title>
<meta property="og:title" content="An awesome endless memories's title" />
<meta property="og:url" content="somepath/digital-marketing/website-digital-gq" />
<meta property="og:description"
content="Sean Connery found fame and fortune as the
suave, sophisticated British agent, James Bond." />
<meta property="og:site_name" content="IMDb" />
<meta property="og:locale" content="en_US" />
<meta property="og:locale:alternate" content="en_GB" />
<meta property="og:locale:alternate" content="cn_CN" />
<meta property="og:image" content={localImage} />
<meta property="og:image:width" content="1600" />
<meta property="og:image:height" content="800" />
</Head>
Facebook's Sharing Debugger returns me
Inferred Property The 'og:image' property should be explicitly
provided, even if a value can be inferred from other tags. Missing
Properties The following required properties are missing: og:url,
og:type, og:title, og:image, og:description, fb:app_id
Could Not Connect To Server Check that the webserver is running, and that there
are no firewalls blocking Facebook's crawlers.
Curl Error Curl error: 56 (RECV_ERROR)
Honestly, I don't have even the beginning of a clue on this story, really, if someone has any hint, would be great,
thanks
Answer - thanks to the hints in the comments.
when you use some URI for your Facebook Open Graph, be sure to target a vali URL, seems to be exclusively the root page of your component in case of NextJS, other languages/libraries/framework could probably follow a similar pattern.
You can set it directly in the facebook sharing link in your code as following:
https://www.facebook.com/sharer/sharer.php?u=[your_operational_url]
you are not obliged to encode the URL if I trust the result of my tests. So just the text of your URL should be enought.
Good builds.

Facebook share doesnt fetch the photo

Hello Ive been struguling with this for a while.. and just cant get my head around it.
I do have the meta tags required :
<link rel="canonical" href="http://www.profsonstage.com" />
<meta property="fb:app_id" content="366418850196673">
<meta property="og:title" content="ProfsOnStage"/>
<meta property="og:site_name" content="ProfsOnStage" />
<meta property="og:description" content="Welocme to ProfsOnStage Web Site" />
<meta property="og:url" content="http://www.profsonstage.com" />
<meta property="og:type" content="article" />
<meta property="og:image" content="http://www.profsonstage.com" />
But when I try to use the share button facebook scraper doesnt fetch any data but the link.
When I check what the scraper sees I get :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script>function set_cookie(){var now = new Date();var time = now.getTime();time += 19360000 * 1000;now.setTime(time);document.cookie='beget=begetok'+'; expires='+now.toGMTString()+'; path=/';}set_cookie();location.reload();;</script>
</head>
<body></body>
</html>
I hope anyone can point me into the right direction to fix this. Checked a lot of similar questions but I was unable to find an answer regarding this issue.
Also I get this in my console log
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
And My APP urls are :
www.profsonstage.com/
profsonstage.com/
I just don`t understand what is the problem here.
Seems like its a hosting issue. If anyone get a problem like that contact your hosting provider.

Facebook bad response code with Headway theme and WordPress SEO

I’ve searched the web up and down for hours w/o finding an answer. I simply cannot post/share my recent posts to Facebook and show anything other than the url. No image or excerpt.
I'm using Headway Wordpress Theme and Wordpress SEO to automatically add all og tags.
Here's the most recent post source og tags:
<!-- Title -->
<title>My Landlord Wants Me To Add My Boyfriend To My Lease. Do I Have To? | San Francisco Tenant Lawyers</title>
<!-- This site is optimized with the Yoast WordPress SEO plugin v1.4.24 - http://yoast.com/wordpress/seo/ -->
<meta name="robots" content="noodp,noydir"/>
<meta name="description" content="Tell your landlord that it's beneficial to her to allow you to add your boyfriend as a subtenant. If you move out she can increase the rent to market rate."/>
<link rel="canonical" href="http://crowandrose.com/2014/01/landlord-wants-add-boyfriend-lease/" />
<link rel="publisher" href="https://plus.google.com/104583554159124890350/about"/>
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="og:title" content="My Landlord Wants Me To Add My Boyfriend To My Lease. Do I Have To? | San Francisco Tenant Lawyers" />
<meta property="og:description" content="Tell your landlord that it's beneficial to her to allow you to add your boyfriend as a subtenant. If you move out she can increase the rent to market rate." />
<meta property="og:url" content="http://crowandrose.com/2014/01/landlord-wants-add-boyfriend-lease/" />
<meta property="og:site_name" content="San Francisco Tenant Lawyers" />
<meta property="article:publisher" content="https://www.facebook.com/pages/Crow-Rose-Attorneys-At-Law/68192891917" />
<meta property="article:author" content="https://www.facebook.com/pages/crow-rose-attorneys-at-law/68192891917" />
<meta property="article:tag" content="consent" />
<meta property="article:tag" content="Lease" />
<meta property="article:tag" content="Rent Ordinance" />
<meta property="article:tag" content="Roommates" />
<meta property="article:tag" content="Subletting" />
<meta property="article:section" content="Tenant Law" />
<meta property="article:published_time" content="2014-01-22T10:37:56+00:00" />
<meta property="article:modified_time" content="2014-01-22T10:49:27+00:00" />
<meta property="fb:app_id" content="103449812457" />
<meta property="og:image" content="http://crowandrose.com/wp-content/uploads/2014/01/gift-horse-e1390405080789.jpg" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:site" content="#Evict_This"/>
<meta name="twitter:domain" content="San Francisco Tenant Lawyers"/>
<meta name="twitter:creator" content="#https://twitter.com/evict_this"/>
<!-- / Yoast WordPress SEO plugin. -->
Until November 23, 2013. I was able to share sporadically with the thumbnail and excerpt showing. I say off and on, never consistent.
All of my Facebook post/share attempts show this in the Facebook debugger.
Response Code 403
Critical Errors That Must Be Fixed
Bad Response Code URL returned a bad HTTP response code.
Warning
Errors That Must Be Fixed
Missing Required Property The 'og:type' property is required, but not present.
The og tags are all in place and have been for years. Clearly the 'og:type' property is present.
Today I deleted my facebook app in case that was the culprit. Still all 403 errors.
I just don’t get it. Anything you can suggest? Is there something I can add to .htaccess?
My site is http://crowandrose.com.
I allowed facebook's crawlers in my .htaccess per this:
Facebook Crawler
A number of Platform services such as Social Plugins and the Open Graph require our systems to be able to reach your web pages. We recognize that there are situations where you might not want these pages on the public Internet, during testing or for other security reasons.
To facilitate this, you should make exceptions in your security systems to allow Facebook to crawl these pages by adding the following IP ranges, accurate as of March 2013.
31.13.24.0/21
31.13.64.0/18
66.220.144.0/20
69.63.176.0/20
69.171.224.0/19
74.119.76.0/22
103.4.96.0/22
173.252.64.0/18
204.15.20.0/22
2401:db00::/32
2620:0:1c00::/40
2a03:2880::/32
Please note that these IP ranges can and do change regularly, so you should periodically run the following command to receive an updated list -
whois -h whois.radb.net -- '-i origin AS32934' | grep ^route
My last question is, Where do I enter the command?

Where is facebook pulling my canonical url from?

page in question:
https://play.decksi.com/share/45431f8d
faceook debugger link:
https://developers.facebook.com/tools/debug/og/object?q=https%3A%2F%2Fplay.decksi.com%2Fshare%2F45431f8d
For some reason, facebook is taking our app page ID as the canonical url, despite it not being on the page at all...
I have the exact same view on a sandboxed instance, and it behaves fine..
This worked fine until today (well i noticed today)...
Any thoughts?
Facebook's Debug Tool does already show why it picked up the apps.facebook.com page as the canonical URL, but in case you need to manually check:
It's in the HTML source of that page:
$curl 'https://play.decksi.com/share/45431f8d'
<!DOCTYPE html>
<html class="decksi_switchboard">
<head>
<meta property="og:title" content="Decksi" />
<meta property="og:type" content="activity" />
<meta property="og:url" content="https://apps.facebook.com/playdecksi" />
<meta property="og:image" content="https://play.decksi.com/Content/img/decksi_logo_bg.png" />
<meta property="og:site_name" content="Decksi" />
<meta property="fb:admins" content="100002131000570" />
Ah! so the answer is in fact, that we are geo-gatting this content (canada) and of course facebook is hitting from a US server!! So my curl doesn't look like yours, voila. – Monsters X 8 secs ago edit

How to set title, img, and description on wall post made from facebook comments

I'm building a facebook iFrame application that uses facebook comments. When a user leaves a comment the default action is that this comment will be posted to their wall. The wall post is something along the lines of
UserX commented on example.com
# the comment text goes here
http://example.com
apps.facebook.com
You should be able to include an image, a description, and set the link to be the title of the page (where it says http://example.com above the apps.facebook.com), but I'm having no luck getting this to work.
I thought it would grab the information from my meta tags (as long as they included the appropriate 'og' tags), but that isn't working. Nor am I able to define values for title, url, image etc. in the same way that you can for normal wall posts.
Anyone have any idea how to get this working??
EDIT:
Here are the meta tags I currently am using.
<meta property="og:title" content="USERNAME'S PAGE" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://example.com"/>
<meta property="og:image" content="http://example.com/images/wall-post.png" />
<meta property="og:description" content="Some description goes here." />
Use URL Linter to Debug
http://developers.facebook.com/tools/lint/
Make sure all meta tags are correct and if you've made some changes, it takes some time to update for facebook and here's a sample, this is a working version:
<!doctype html>
<html xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml" lang="en">
<head>
<meta charset="utf-8">
<title>Facebook Comment Box Sample</title>
<meta property="og:title" content="YOUR-POST-TITLE"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://YOUR-SITE-URL"/>
<meta property="og:image" content="http://YOUR-IMAGE-URL"/>
<meta property="og:site_name" content="YOUR-SITE-TITLE"/>
<meta property="og:description" content="YOUR-DESCRIPTION"/>
<meta property="fb:admins" content="YOUR-USER-ID"/>
</head>
<body>
<h1>Facebook Comment Box:</h1>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:comments href="http://YOUR-SITE-URL" num_posts="10" width="500"></fb:comments>
</body>
</html>
OK, after a lot of stumbling around I figured this out.
My iFrame application requires facebook authentication before accessing the application (as I believe all facebook apps do). This means that the facebook crawlers were unable to crawl my homepage and pick up the og: meta tags.
To solve this I first had to figure out what the facebook crawler looks like. I logged the HTTP_USER_AGENT for all requests and then used the facebook URL Linter (http://developers.facebook.com/tools/lint/) to ping my site.
The facebook crawler identifies itself as "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
Once I had that I was able to just add a little conditional logic to let the crawler bypass authentication and access my site. I hope this helps others.
First I made sure I had all my meta properties set, then I just put my code in this:
if (strpos($_SERVER['HTTP_USER_AGENT'],"externalhit_uatext")<5)
{
}