我正在创建一个在线HTML5/Javascript测验。我通过Facebook和Twitter分享测验的结果。消息传递是通过Javascript创建的,“我刚刚得到了X条Y正确的问题”定制Google +分享文字(片段)
我想对Google Plus做同样的事情。但是,看起来“片段”是由页面上的schema.org,Open Graph或Title/Description标记生成的。这里的文档:https://developers.google.com/+/plugins/snippet/
我想我可以通过PHP中的查询字符串参数动态生成这些标签,但它看起来像Google缓存页面。有任何想法吗?
PHP:
<?php
$correct = strval($_GET['correct']);
$title = "I took the Quiz and answered " . $correct . " of 9 questions correctly.";
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo($title); ?></title>
<meta property="og:title" content="<?php echo($title); ?>" />
</head>
</html>
我动态创建网址.../share.php正确= 4
但是,当我分享网页,我看到消息:
I took the Quiz and answered of 9 questions correctly.
它似乎没有显示动态数据。我假设是因为Google缓存了该页面?
谢谢