Skip to content

Instantly share code, notes, and snippets.

@edorcutt
Created November 27, 2010 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edorcutt/718197 to your computer and use it in GitHub Desktop.
Save edorcutt/718197 to your computer and use it in GitHub Desktop.
Integrate the Facebook Like Button onto the LinkedIn Company web pages.
{
meta {
name "LinkedIn_Like"
description <<
Integrate the Facebook Like Button onto the LinkedIn Company web pages.
>>
author "Ed Orcutt"
logging off
// Facebook Application ID and Application Secret
key facebook {
"consumer_key" : "YOURKEY",
"consumer_secret" : "YOURSECRET"
}
}
dispatch {
domain "www.linkedin.com"
}
global {
css <<
.linkedlike {
float: right;
height: 23px;
margin-top: 6px;
margin-botton: 10px;
}
>>;
}
////////////////////////////////////////
// Authorize Facebook Application
rule facebook_app_auth is active {
select using ".*" setting ()
if (not facebook:authorized()) then
facebook:authorize(["publish_stream","email","user_photos","read_stream",
"user_notes","offline_access","user_about_me","user_notes",
"user_photos","user_likes","user_online_presence"
])
with opacity = 1 and
sticky = true;
fired { last; }
}
rule Plant_Facebook_Like_Button is active {
select when pageview "/company/([\w\-]*)" setting (companyName)
pre {
LikeButton = <<
<span class="linkedlike"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.linkedin.com%2Fcompany%2F#{companyName}&amp;layout=standard&amp;show_faces=false&amp;width=385&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:385px; height:23px;" allowTransparency="true"></iframe></span>
>>;
}
prepend("div#section-header", LikeButton);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment