I’m trying to integrate my Meteor application with Facebook Open Graph, to publish actions in the timeline.
Facebook API works by defining object specific meta tags in the HTML head, that will be read by the API. For example:
<head prefix="og: http://ogp.me/ns# [YOUR_APP_NAMESPACE]:
http://ogp.me/ns/apps/[YOUR_APP_NAMESPACE]#">
<title>OG Tutorial App</title>
<meta property="fb:app_id" content="[YOUR_APP_ID]" />
<meta property="og:type" content="[YOUR_APP_NAMESPACE]:recipe" />
<meta property="og:title" content="Stuffed Cookies" />
<meta property="og:image" content="http://fbwerks.com:8000/zhen/cookie.jpg" />
<meta property="og:description" content="The Turducken of Cookies" />
<meta property="og:url" content="http://fbwerks.com:8000/zhen/cookie.html">
</head>
However, what Facebook API sees when inspecting any URL is something like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/ed99236548322b46a7562b49cd6ee0e0f059e506.css">
<script type="text/javascript" src="/c16ff21884b1f831d91ebf271236ef78b03b552e.js"></script>
<title>Made with Meteor!</title>
</head>
<body>
</body>
</html>
What is the best way of integrating this meta tags, that may change depending on the URL, in the Meteor application?
I encountered the same issue.
Two ways to deal with this:
(NOTE: you will probably need to not use autopublish package with this solution, since “spiderable” stops the page rendering while relying on a flag that “autopublish” sets to “true” right on client startup)
https://github.com/ayal/headly
After installation you use it like so: