1

Facebook Graph API 经常出现这样的非 JSON 错误页面是否“正常”。我应该期望/需要建立多少?我在速率限制之内。

https://graph.facebook.com/...../posts?access_token=<ACCESS TOKEN>&limit=25&until=1373675948

<!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" id="facebook">
  <head>
    <title>Facebook | Error</title>
    <meta http-equiv="Content-Type"  content="text/html; charset=utf-8" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="robots"              content="noindex,nofollow" />
    <style type="text/css">
      html, body {
        margin:       0px;
        padding:      0px;
        text-align:   center;
        font-family:  "Lucida Grande", "Tahoma", "Verdana", "Arial", sans-serif;
        color:        #333333;
      }

      a.menu {
        margin:     auto;
        position:   relative;
        display:    block;
        width:      964px;
        height:     29px;
        background: #3B5998 url('https://s-static.ak.fbcdn.net/common/error.png')
                    top center no-repeat;
      }

      .core {
        text-align: left;
        margin:     auto;
        width:      904px;
        padding:    1em 0em;
      }

      h1 {
        font-size:  18px;
      }

      p {
        font-size:  13px;
      }

      .footer {
        border-top: 1px solid #DDDDDD;
        color:      #777777;
        float:      left;
        width:      904px;
        padding:    5px 8px 6px 0;
        font-size:  11px;
      }
    </style>
    <script type="text/javascript" charset="utf-8">
      function back() {
        if (1 < history.length) {
          history.back();
          return false;
        }
        return true;
      }
    </script>
  </head>
  <body>
    <a class="menu" href="http://www.facebook.com/"></a>
    <div class="core">
      <h1>Sorry, something went wrong.</h1>
      <p>We're working on getting this fixed as soon as we can.</p>
      <p><a onclick="return back();" href="http://www.facebook.com/">Go Back</a></p>
      <div class="footer" id="pagefooter_copyright">
        Facebook &copy;
        2013
        &#183;
        <a href="http://www.facebook.com/help/">Help</a>
      </div>
    </div>
  </body>
</html>
4

1 回答 1

0

我从来不知道为什么会发生这些错误。我相信它们与来自非美国的用户有关。在我看来,如果我重复这个电话,他们会无限期地坚持下去。

通过检测返回的结果是否是 JSON 对象,我最终丢弃了这些请求。

function isJSON(str) {
    if (typeof str === 'object') {
        return true;
    } else {
        return false;
    }
}
于 2014-01-08T23:00:11.810 回答