8000 GitHub - ayal/headly: meteor package to handle facebookexternalhit responses (for og:metatags use)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ headly Public

meteor package to handle facebookexternalhit responses (for og:metatags use)

Notifications You must be signed in to change notification settings

ayal/headly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

headly

meteor package to handle external service requests to generate metatag responses (for og:metatags use)

Install

Use meteorite

Then add headly to your meteor app using:

mrt add headly

... or ... you can clone the code to your meteor/packages directory manually

config headly

In your server code use something like:

Meteor.headly.config({
    data: function(req){
      //do something dynamic here, i.e get title from db based on url param
      return {title: dynamic.title};
    },
    facebook: function(data) {
      return '<meta property="og:title" content="'+data.title+'" />';
    },
    twitter: function(data) {
      return '<meta name="twitter:card" content="summary"> ';
}});

.. or try the example first to get the hang of it:

  • run the example using meteor

  • navigate to the server where the example runs like so: http://theserver/fffuu/madly

  • click the link to see the result in the facebook debugger

  • navigate to the server where the example runs like so: http://theserver/headly/madly

  • click the link to see the result in the facebook debugger

  • you can also try to post "http://theserver/headly/madly" to facebook and see how it handles it

  • look at the example's code to see what just happened

About

meteor package to handle facebookexternalhit responses (for og:metatags use)

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0