URL返回Facebook Share中所需的错误HTTP响应代码/ 401授权

时间:2014-03-06 07:56:40

标签: facebook

以下是我为Facebook调试工具尝试的内容:

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fdevstmaws.linesofphp.com%2Fvideo%2Findex%2F52f0fd544eab99ae28000106

废弃信息:

Response Code   401
Fetched URL http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106
Canonical URL   http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106
Warning
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.
Notice
Open Graph Warnings That Should Be Fixed
Inferred Property   The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property   The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags.
URLs
Graph API   https://graph.facebook.com/1419346681640654
Scraped URL  See exactly what our scraper sees for your URL

我想分享的网址是:http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106

可能是什么原因?它不再是我的网站了。

Scraper response: Document returned no data

元标记:

<meta property="og:image" content="http://devstmaws.linesofphp.com/static/img/logo_facebook.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="300" />
<meta property="og:image:height" content="300" />
<meta property="og:title" content="Check out my awesome video!" />
<meta property="og:site_name" content="Check out my awesome video!" />
<meta property="og:description" content="SearchTheMusic gives you the ability to legally add music to your videos and share them with the world!" />
<meta property="og:url" content="http://devstmaws.linesofphp.com/video/index/52f0fd544eab99ae28000106" />

4 个答案:

答案 0 :(得分:2)

Facebook必须能够访问Open Graph标记的URL才能正常工作,并且您的URL受密码保护。只能使用公共URL。您会收到与取消授权弹出窗口相同的错误。

答案 1 :(得分:0)

我也给你其他方式。在这里我删除了javascript SDK.Other都是一样的     采取中间步骤。
    所以我采取这个步骤:      我在项目文件夹(密码保护)之外创建了文件夹.i.e。 outerface.And创建一个文件,比如projectfront.php      第一:         定义了一个外部网址     在这里,我使用了上述文件路径。所以现在Facebook不能虐待我。

<?php 
 $faceproject_url='[your servar path]/outerface/projectfront.php'; 

?>
<div class="fb-share-button" data-href="<?php echo $faceproject_url; ?>" data-type="button_count"></div>

 Second:
 In outerface/projectfront.php-
I have written(with proper doctype) as:
......
........
<script>
function xyz()
{
url=[Give your target link];// it will your project page, which you want to share.
window.location=url;
}
</script>
</head>
<body onload="xyz()">

<?php 
ob_start(); 
?>
Please wait....
</body>
</html>
[please do proper html]

So now if any user click on your share button, share'll be successfully done and Facebook will not obstacle us. Also If you click on link on Facebook(in wall) after share, you will redirect successfully to your link defined in projectfront.php.

Thanks
Atanu Mitra

答案 2 :(得分:0)

当获取页面的URL与OG:URL不匹配时,通常会收到此错误。

答案 3 :(得分:-1)

使用javascript SDK for Facebook 我已经克服了中间步骤。     我的项目网址也受密码保护。

所以我采取了这个步骤:

  1. 我在项目文件夹(密码保护)之外创建了文件夹.i.e。 outerface.And创建一个文件,比如projectfront.php

  2. 使用Facebook sdk调用函数并使用FB.ui({ with method:feed。我采取了一些技巧。在链接中,我使用了上述文件路径。所以现在Facebook不能虐待我。

  3.  <div><a  href="javascript:void(0);" onclick = "sharesend()">share</a></div>
    <script>
    function sharesend()
    {
      FB.ui({
         method: 'feed',          
         link: '[your servar path]/outerface/projectfront.php',
         picture: [give picture, if you can],
         caption: [give any caption],
         description: [give any description],
              .....................,
              ..............
        }, 
        function(response){}
         );
    }
    </script>
    

    外部/ projectfront.php 中 - 我写了(使用适当的doctype):

    ......
    ........
    <script>
    function xyz()
    {
    url=[Give your target link];// it will your project page, which you want to share.
    window.location=url;
    }
    </script>
    </head>
    <body onload="xyz()">
    
    <?php 
    ob_start(); 
    ?>
    Please wait....
    </body>
    </html>
    [please do proper html]
    

    现在,如果任何用户点击您的分享按钮,分享将成功完成,Facebook将不会阻碍我们。此外,如果您在共享后点击Facebook(墙上)上的链接,您将成功重定向到projectfront.php中定义的链接。

    由于 Atanu Mitra