<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dorianroy.com/blog</title>
	<atom:link href="http://dorianroy.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://dorianroy.com/blog</link>
	<description>just another dev blog</description>
	<lastBuildDate>Sun, 18 Sep 2011 19:21:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How To Make A Friendly Facebook Like Button</title>
		<link>http://dorianroy.com/blog/2010/04/how-to-make-a-friendly-facebook-like-button/</link>
		<comments>http://dorianroy.com/blog/2010/04/how-to-make-a-friendly-facebook-like-button/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 18:48:18 +0000</pubDate>
		<dc:creator>Dorian</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://dorianroy.com/blog/?p=10</guid>
		<description><![CDATA[First I was very excited when I saw the new Facebook Like Button. But when I checked the code to see how it works, I noticed that this button actually allows Facebook to track all the Facebook users on your site, no matter if they click it or not (see my previous post on how this [...]]]></description>
			<content:encoded><![CDATA[<p>First I was very excited when I saw the new <a href="http://developers.facebook.com/docs/reference/plugins/like">Facebook Like Button</a>. But when I checked the code to see how it works, I noticed that this button actually allows Facebook to track all the Facebook users on your site, no matter if they click it or not (see my <a href="http://dorianroy.com/blog/2010/04/how-facebooks-like-button-works/">previous post</a> on how this works).</p>
<p>As a publisher, you might not want to annoy the visitors of your site with that. So I hacked together an alternative like button, that only connects to Facebook if you click it. Once you have clicked it, it looks and behaves the same as the original button (actually, it&#8217;s replaced by the original button when you click it). This way users can decide if they want to let Facebook know that they have visited your site. Try it here:<br />
<span id="more-10"></span></p>
<link rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/zD5ZK/hash/4146lpfk.css" type="text/css" />
<p><script type="text/javascript">// <![CDATA[
	var fbURL = "http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdorianroy.com%2Fblog%2F2010%2F04%2Fhow-to-make-a-friendly-facebook-like-button%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light";
	function insertLikeButton() {
		var container = document.getElementById('flbCont');
		var w = container.style.width;
		var h = container.style.height;
		fbFrame = document.createElement("IFRAME"); 
		fbFrame.setAttribute("src", fbURL);
		fbFrame.setAttribute("scrolling", "no");
		fbFrame.setAttribute("frameBorder", 0);
		fbFrame.setAttribute("allowTransparency", true);
		fbFrame.style.border = "none";
		fbFrame.style.overflow = "hidden";
		fbFrame.style.width = w; 
		fbFrame.style.height = h; 
		container.replaceChild(fbFrame, document.getElementById('flb'));
	}
// ]]&gt;</script></p>
<div id="flbCont" class="connect_widget"><a id="flb" class="connect_widget_like_button clearfix like_button_no_like" style="cursor: pointer; text-decoration: none;" onclick="insertLikeButton();"><span class="liketext" style="line-height: 1;">Show Facebook Likes</span></a></div>
<p>&nbsp;</p>
<p>Here is how you can put this button on your website:</p>
<ol>
<li>Copy the code snippet from <a href="http://gist.github.com/378594" target="_blank">here</a> and put it in the HTML code of your page where you want the button to appear.</li>
<li>Go to this <a href="http://developers.facebook.com/docs/reference/plugins/like" target="_blank">code-generator on Facebook</a> and configure the button (usually you only need to enter your URL).</li>
<li>When you&#8217;re done, click &#8220;Get Code&#8221; on the Facebook-page.</li>
<li>From the iframe-field, copy only the characters from the first to the second quotation mark. Make sure you don&#8217;t miss the quotation marks, as shown here:<a href="http://dorianroy.com/blog/wp-content/uploads/2010/04/Screen-shot-Facebook-Snippet.png"><img class="size-full wp-image-40 alignnone" style="margin-top: 8px; margin-bottom: 8px;" title="Screen-shot-Facebook-Snippet" src="http://dorianroy.com/blog/wp-content/uploads/2010/04/Screen-shot-Facebook-Snippet.png" alt="Screenshot from the Facebook code generator" width="496" height="311" /></a></li>
<li>Paste this text into the code you&#8217;ve inserted in your page in step 1: just replace the string &#8220;PASTE_FACEBOOK_URL_HERE&#8221;. Keep the trailing semicolon after the end of the string.</li>
</ol>
<p>That&#8217;s it! You should see the button expand when you click it and load the real like button.</p>
<p>If you want to change the text of the button: it&#8217;s located in the next to last line of the code. Just change it to whatever you like. The button will resize to the length of the text.</p>
<p>This code basically just displays a button and applies a stylesheet from Facebook to it, so it looks exactly like the real like button. Of course you can replace it with your own customized button. Just make sure that the ids of the button and its container stay the same (&#8220;flb&#8221; and &#8220;flbCont&#8221;) and that it calls insertLikeButton() when clicked. This function replaces your button with an iframe that sends your parameters and the user&#8217;s cookie to facebook and loads the actual like button and friends info.</p>
<p>If you have problems with the width and height of the expanded button, you should give the container div named &#8220;flbCont&#8221; a size that fits your needs. The loaded iframe will be resized to these dimensions.</p>
]]></content:encoded>
			<wfw:commentRss>http://dorianroy.com/blog/2010/04/how-to-make-a-friendly-facebook-like-button/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>How Facebook&#8217;s Like Button Works</title>
		<link>http://dorianroy.com/blog/2010/04/how-facebooks-like-button-works/</link>
		<comments>http://dorianroy.com/blog/2010/04/how-facebooks-like-button-works/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 08:36:59 +0000</pubDate>
		<dc:creator>Dorian</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://dorianroy.com/blog/?p=60</guid>
		<description><![CDATA[Facebook has introduced a new Like Button together with some other &#8220;social plugins&#8221; at their f8 conference last week. Everybody can put it on their website so that visitors can &#8220;like&#8221; a page and add it to their Facebook profile without leaving the site. This button actually allows Facebook to track all visitors of the external [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook has introduced a new <a href="http://developers.facebook.com/docs/reference/plugins/like" target="_blank">Like Button</a> together with some other &#8220;social plugins&#8221; at their f8 conference last week. Everybody can put it on their website so that visitors can &#8220;like&#8221; a page and add it to their Facebook profile without leaving the site.</p>
<p>This button actually allows Facebook to track all visitors of the external site, no matter if they click it or not (as long as they are Facebook users &#8211; but who isn&#8217;t?). Facebook can do that because they use an iframe to display the button. An iframe is something like an embedded browser window within a page. The difference between using an iframe and a simple image for the button is that the iframe contains a complete web page &#8211; from Facebook. <span id="more-60"></span>There is not much going on on this page, except for the button and the information about how many people have liked the current page. <a href="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fdevelopers.facebook.com%2F&amp;amp;layout=standard&amp;amp;show_faces=true&amp;amp;width=450&amp;amp;action=like&amp;amp;colorscheme=light" target="_blank">Click here</a> to open a like button page in a new window.</p>
<p>So when you see a like button on cnn.com, you are actually visiting a Facebook page at the same time. That allows Facebook to read a cookie on your computer, which it has created the last time you&#8217;ve logged in to Facebook. The cookie remains on your computer for months, even when you didn&#8217;t check the &#8220;keep me logged in&#8221;-option in the login form. It contains your Facebook user-id. A fundamental security rule in every browser is that only the website that has created a cookie can read it later on. And that is the advantage of the iframe: it allows Facebook to read your Facebook-cookie even when you are visiting a different website. That&#8217;s how they recognize you on cnn.com and display your friends there.</p>
<p>What I don&#8217;t like about this is that it is not opt-in. You&#8217;re not asked to be tracked on external sites by Facebook, and there is also no opt-out in the Facebook privacy settings. Honestly, you can&#8217;t blame Facebook for that, because there is no way they could check your privacy settings before they know who you are. The only way you can avoid being tracked by Facebook on other sites is to logout of Facebook before visiting any other site. That will delete the cookie.</p>
<p>(If you have a website or blog and want to include the like button, but do not want it to track the users without their consent, have a look at <a href="http://dorianroy.com/blog/2010/04/how-to-make-a-friendly-facebook-like-button/">this post</a> where you can see how to make a like button with opt-in)</p>
]]></content:encoded>
			<wfw:commentRss>http://dorianroy.com/blog/2010/04/how-facebooks-like-button-works/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

