2015-11-07 27 views
0

我無法讓我的開放圖標記訪問到Facebook。當我嘗試共享頁面時,該網站鏈接正常,但不顯示og屬性,標題僅顯示爲「422」。我不確定這是什麼意思。打開圖形元標記不可訪問,Facebook的頁面預覽顯示「422」?

當我運行的Facebook調試https://developers.facebook.com/tools/debug/og/object/我碰到下面的錯誤,這是不是非常有幫助:

Error parsing input URL, no data was cached, or no data was scraped. 

在調試工具使用回聲功能,我得到的是:

Document returned no data 

的meta標籤似乎被我的文檔中正確設置:

<!DOCTYPE html> 
<html> 
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1" /> 
    <meta name="robots" content="noarchive,noodp,noydir" /> 
    <meta name="referrer" content="always" /> 
    <meta property="fb:app_id" content="375576830972731" /> 
    <meta property="og:site_name" content="Site Name" /> 
    <meta property="og:title" content="Title of content" /> 
    <meta property="og:url" content="https://website.domain.com/123456" /> 
    <meta property="og:image" content="http://s3-us-west-1.amazonaws.com/domain/media/images/001/original/001" /> 
    <meta property="og:description" content="Description of content" /> 
    <meta property="og:type" content="article" /> 
</head> 

我確保允許Facebook抓取者在robots.txt

User-agent: Facebot 
Allow:/

User-agent: facebookexternalhit/1.1 
Allow:/

我失蹤了什麼?

+0

你試圖分享的網址是什麼? – WizKid

+0

我第一次裝載它永遠花了。並且調試頁面也說暫停 – WizKid

+0

它馬上加載我? – alphaleonis

回答

0

這裏的問題是我在application.rb中的protect_from_forgery方法。我添加了一個異常,Facebot現在可以看到該頁面。

class StoriesController < ApplicationController  
    protect_from_forgery except: :show