<?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>sundh.com &#187; Facebook Connect</title>
	<atom:link href="http://www.sundh.com/blog/tag/facebook-connect/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sundh.com/blog</link>
	<description>Technology / Wood / Electronics</description>
	<lastBuildDate>Thu, 19 Jan 2012 11:54:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Post to Facebook with Javascript SDK</title>
		<link>http://www.sundh.com/blog/2010/12/post-to-facebook-with-javascript-sdk/</link>
		<comments>http://www.sundh.com/blog/2010/12/post-to-facebook-with-javascript-sdk/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 12:55:12 +0000</pubDate>
		<dc:creator>Ellen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Facebook Connect]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.sundh.com/blog/?p=408</guid>
		<description><![CDATA[Posting a message to someones wall can contain the following parameters:

var my_message = &#8216;This is just a test!&#8217;;
var url = &#8216;http://www.sundh.com/&#8217;;
var title = &#8216;This is the name of my post&#8217;;
var desc = &#8216;Optional description of my link&#8217;;
var picUrl = &#8216;http://www.sundh.com/blog/images/led.jpg&#8217;;

To post the following to my wall this javascript code is executed:

FB.api&#40;&#8216;/me/feed&#8217;, &#8216;post&#8217;, &#123;message:my_message,link:url,name:title,picture:picUrl,description:desc &#125;,
function&#40;response&#41; &#123;
if [...]]]></description>
			<content:encoded><![CDATA[<p>Posting a message to someones wall can contain the following parameters:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="kw2">var</span> my_message <span class="sy0">=</span> <span class="st0">&#8216;This is just a test!&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> url <span class="sy0">=</span> <span class="st0">&#8216;http://www.sundh.com/&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> title <span class="sy0">=</span> <span class="st0">&#8216;This is the name of my post&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> desc <span class="sy0">=</span> <span class="st0">&#8216;Optional description of my link&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> picUrl <span class="sy0">=</span> <span class="st0">&#8216;http://www.sundh.com/blog/images/led.jpg&#8217;</span><span class="sy0">;</span></div>
</div>
<p>To post the following to my wall this javascript code is executed:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">FB.<span class="me1">api</span><span class="br0">&#40;</span><span class="st0">&#8216;/me/feed&#8217;</span><span class="sy0">,</span> <span class="st0">&#8216;post&#8217;</span><span class="sy0">,</span> <span class="br0">&#123;</span>message<span class="sy0">:</span>my_message<span class="sy0">,</span>link<span class="sy0">:</span>url<span class="sy0">,</span><span class="kw3">name</span><span class="sy0">:</span>title<span class="sy0">,</span>picture<span class="sy0">:</span>picUrl<span class="sy0">,</span>description<span class="sy0">:</span>desc <span class="br0">&#125;</span><span class="sy0">,</span><br />
<span class="kw2">function</span><span class="br0">&#40;</span>response<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>response <span class="sy0">||</span> response.<span class="me1">error</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&#8216;Error occured&#8217;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
<span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&#8216;Post ID: &#8216;</span> <span class="sy0">+</span> response.<span class="me1">id</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>If I decided to not define the parameter &#8220;description&#8221; the post will grab the text appearing on the URL.<br />
<img class="size-full wp-image-414 alignnone" title="facebook_post" src="http://www.sundh.com/blog/wp-content/uploads/2010/12/facebook_post1.jpg" alt="facebook_post" width="360" height="186" /></p>
<h3>Youtube clip</h3>
<p>Posting a YouTube clip to someone&#8217;s wall requires a little bit different code in order to be able to play the YouTube clip within Facebook. Note that the URL to the YouTube clip is different from the URL shown in the browser when you watch the clip. Instead of &#8220;http://www.youtube.com/watch?v=VIDEO_ID&#8221;, it is set to &#8220;http://www.youtube.com/v/VIDEO_ID&#8221;. The thumbnail of the YouTube clips is easly retreived by accesing the URL &#8220;http://img.youtube.com/vi/VIDEO_ID/0.jpg&#8221;. </p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="kw2">var</span> my_message <span class="sy0">=</span> <span class="st0">&#8216;My message here&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> url <span class="sy0">=</span> <span class="st0">&#8216;http://www.youtube.com/v/VIDEO_ID&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> title <span class="sy0">=</span> <span class="st0">&#8216;Title of YouTube clip&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> desc <span class="sy0">=</span> <span class="st0">&#8216;Description of YouTube clip&#8217;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> picUrl <span class="sy0">=</span> <span class="st0">&#8216;http://img.youtube.com/vi/VIDEO_ID/0.jpg&#8217;</span><span class="sy0">;</span></div>
</div>
<p>The trick that makes the YouTube clip embeddable on Facebook is to add the parameter &#8220;source&#8221; in you API call to Facebook. The source is the same as the URL to the video clip.</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">FB.<span class="me1">api</span><span class="br0">&#40;</span><span class="st0">&#8216;/me/feed&#8217;</span><span class="sy0">,</span> <span class="st0">&#8216;post&#8217;</span><span class="sy0">,</span> <span class="br0">&#123;</span>message<span class="sy0">:</span>my_message<span class="sy0">,</span>link<span class="sy0">:</span>url<span class="sy0">,</span><span class="kw3">name</span><span class="sy0">:</span>title<span class="sy0">,</span>picture<span class="sy0">:</span>picUrl<span class="sy0">,</span>source<span class="sy0">:</span>url<span class="sy0">,</span>description<span class="sy0">:</span>desc <span class="br0">&#125;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span>response<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>response <span class="sy0">||</span> response.<span class="me1">error</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&#8216;Error occured&#8217;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">&#8216;Post ID: &#8216;</span> <span class="sy0">+</span> response.<span class="me1">id</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>The result looks like this:<br />
<img class="size-full wp-image-427 alignnone" title="facebook_youtube" src="http://www.sundh.com/blog/wp-content/uploads/2010/12/facebook_youtube.jpg" alt="facebook_youtube" width="435" height="216" /></p>]]></content:encoded>
			<wfw:commentRss>http://www.sundh.com/blog/2010/12/post-to-facebook-with-javascript-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Connect: Only for grown ups</title>
		<link>http://www.sundh.com/blog/2010/02/facebook-connect-only-for-grown-ups/</link>
		<comments>http://www.sundh.com/blog/2010/02/facebook-connect-only-for-grown-ups/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:03:45 +0000</pubDate>
		<dc:creator>Ellen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Facebook Connect]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.sundh.com/blog/?p=98</guid>
		<description><![CDATA[In some Facebook Connect apps you might want to target an older audience. Any Facebook user is required to fill in their date of birth so the birthday field of the profile can be a way to check that your user has the appriopriate age for your application. This can be done by checking the [...]]]></description>
			<content:encoded><![CDATA[<p>In some Facebook Connect apps you might want to target an older audience. Any Facebook user is required to fill in their date of birth so the birthday field of the profile can be a way to check that your user has the appriopriate age for your application. This can be done by checking the birthday date of the user (birthday_date) using  the function</p>
<div class="codesnip-container" >users_getInfo($uid, &#8216;birthday_date&#8217;).</div>
<p><img class="size-medium wp-image-99 alignleft" title="birhtdate" src="http://www.sundh.com/blog/wp-content/uploads/2010/02/birhtdate-300x109.jpg" alt="birhtdate" width="300" height="109" /></p>
<p>Important to remember though is that if the Facebook user has chosen not to show the birth year, this will not be available for the Facebook Connect application. To determine that the Facebook user has the appropriate age her settings on Facebook must look as follows:</p>]]></content:encoded>
			<wfw:commentRss>http://www.sundh.com/blog/2010/02/facebook-connect-only-for-grown-ups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Connect: No server-side needed</title>
		<link>http://www.sundh.com/blog/2010/01/facebook-connect-no-server-side-needed/</link>
		<comments>http://www.sundh.com/blog/2010/01/facebook-connect-no-server-side-needed/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:27:44 +0000</pubDate>
		<dc:creator>Ellen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Facebook Connect]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.sundh.com/blog/?p=56</guid>
		<description><![CDATA[With the Facebook Connect API comes javascript functionality. This means no server-side scripting needed. You can create your application on Facebook and connect to it from your website thought javascript. Use the API Key and Secret Key to connect to you application. Make sure your callback URL is set on Facebook to be the URL [...]]]></description>
			<content:encoded><![CDATA[<p>With the Facebook Connect API comes javascript functionality. This means no server-side scripting needed. You can <a href="http://www.facebook.com/developers/createapp.php">create your application on Facebook</a> and connect to it from your website thought javascript. Use the API Key and Secret Key to connect to you application. Make sure your callback URL is set on Facebook to be the URL of the page you are connecting from.</p>
<p>Create your customized Facebook Connect login button through this <a href="http://developers.facebook.com/tools.php?connect_wizard">wizard</a>. Paste in the code into your site.</p>
<p><strong>Enabling calls to the javascript API on Facebook:</strong></p>
<div class="codesnip-container" >&lt;script src=&#8221;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/sv_SE&#8221; type=&#8221;text/javascript&#8221;&gt;&lt;/script&gt;</div>
<p><strong>Generating the login button on your site:</strong></p>
<div class="codesnip-container" >&lt;fb:login-button v=&#8221;2&#8243; size=&#8221;medium&#8221; onlogin=&#8221;window.location.reload(true);&#8221;&gt;Log in to Facebook Connect&lt;/fb:login-button&gt;</div>
<p>The Facebook Connect login will appear in a pop-up window. When successfully logged in, the window closes and your main page reloads.</p>
<p><strong>The output</strong><br />
In the Javascript function FB.ensureInit you can then put in your API calls and generate your HTML from that. Below is an example of showing selected information from a user&#8217;s profile.</p>
<div class="codesnip-container" >&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
var widget_div = document.getElementById(&#8221;profile_pics&#8221;);<br />
FB.ensureInit(function () {<br />
FB.Facebook.get_sessionState().waitUntilReady(function() {</div>
<div class="codesnip-container" >&nbsp;&nbsp;var session = FB.Facebook.apiClient.get_session();</div>
<div class="codesnip-container" >&nbsp;&nbsp;FB.Facebook.apiClient.users_getInfo([session.uid], ["about_me","books","interests","movies","music",<br />
"religion","tv","quotes","education_history","political","sex","meeting_for"],</div>
<div class="codesnip-container" >function(result) {<br />
&nbsp;&nbsp;var markup = &#8220;&#8221;;<br />
&nbsp;&nbsp;for(var o in result[0]) {<br />
&nbsp;&nbsp;markup += &#8220;&lt;br&gt;&#8221; + o + &#8221; : &#8221; + result[0][o];<br />
}<br />
widget_div.innerHTML = markup;<br />
FB.XFBML.Host.parseDomElement(widget_div);<br />
});<br />
});<br />
});<br />
&lt;/script&gt;</div>]]></content:encoded>
			<wfw:commentRss>http://www.sundh.com/blog/2010/01/facebook-connect-no-server-side-needed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add Facebook Connect to your blog comments</title>
		<link>http://www.sundh.com/blog/2009/12/add-facebook-connect-to-your-blog-in-8-minutes/</link>
		<comments>http://www.sundh.com/blog/2009/12/add-facebook-connect-to-your-blog-in-8-minutes/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 10:09:08 +0000</pubDate>
		<dc:creator>Ellen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Facebook Connect]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.sundh.com/blog/?p=44</guid>
		<description><![CDATA[This neat video explains how you can add Facebook Connect to your blog and let users add comments by logging into Facebook Connect! No server-side scripting needed!
]]></description>
			<content:encoded><![CDATA[<p>This neat video explains how you can add Facebook Connect to your blog and let users add comments by logging into Facebook Connect! No server-side scripting needed!<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="576" height="324" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.facebook.com/v/630563174283" /><param name="wmode" value="opaque" /><embed type="application/x-shockwave-flash" width="576" height="324" src="http://www.facebook.com/v/630563174283" wmode="opaque" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>]]></content:encoded>
			<wfw:commentRss>http://www.sundh.com/blog/2009/12/add-facebook-connect-to-your-blog-in-8-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

