小编Chi*_*gde的帖子

facebook open graph meta property og:'website'的类型.属性'object-name'需要一个og:type'object-name'对象

在蛋糕php 1.3中查看ctp我有以下代码:

$url = 'http://example.com/exmp/explus/books/view/'.$book['Book']['id'];

echo $this->Html->meta(array('property' => 'fb:app_id', 'content' => '*******'),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:type', 'content' => 'book'),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:url', 'content' => $url ),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:title', 'content' => $book['Book']['title']),'',array('inline'=>false));

echo $this->Html->meta(array('property' => 'og:description', 'content' => $book['Book']['title']),'',array('inline'=>false));

$imgurl = '../image/'.$book['Book']['id'];

echo $this->Html->meta(array('property' => 'og:image', 'content' => $imgurl ),'',array('inline'=>false)); ?>
Run Code Online (Sandbox Code Playgroud)

当我发布它时,它会出现以下错误

{
   "error": {
      "message": "(#3502) Object at URL http://example.com/exmp/explus/books/view/234'   has   og:type of 'website'. The property 'book' requires an object of og:type 'book'. ",
      "type": "OAuthException",
      "code": …
Run Code Online (Sandbox Code Playgroud)

php facebook cakephp-1.3 facebook-opengraph

1
推荐指数
1
解决办法
9873
查看次数

java查找和替换%

在 java 1.8.0 中,我尝试替换 %,但它不匹配

  String str = "%28Sample text%29";

  str.replaceAll("%29", "\\)");

  str.replaceAll("%28", "\\(");
  System.out.println("Replaced string is " + str);
Run Code Online (Sandbox Code Playgroud)

我已经尝试过所有这些将符号“%”替换为单词“百分比”,但没有任何效果对我有用。提前致谢。

java string replaceall

1
推荐指数
1
解决办法
1971
查看次数