<?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>Jozef Chúťka&#039;s blog &#187; facebook api</title>
	<atom:link href="http://blog.yoz.sk/tag/facebook-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yoz.sk</link>
	<description>My life, my work</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:40:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Neverending Facebook API changes</title>
		<link>http://blog.yoz.sk/2010/07/neverending-facebook-api-change/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=neverending-facebook-api-change</link>
		<comments>http://blog.yoz.sk/2010/07/neverending-facebook-api-change/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 11:35:09 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook api]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=1998</guid>
		<description><![CDATA[Believe it or not, facebook changed part of its api again. Since today, authorizing for iframe applications does not work the same way it used to. Previously it was enough to redirect: &#8230; where facebook authorized your app and redirects back to the: &#8230; where session was valid access_token. Since today the mechanism changed into [...]]]></description>
			<content:encoded><![CDATA[<p>Believe it or not, facebook changed part of its api again. Since today, authorizing for iframe applications does not work the same way it used to. Previously it was enough to redirect:</p>
<pre class="brush: plain; title: ; notranslate">https://graph.facebook.com/oauth/authorize
    ?client_id=268718683475
    &amp;redirect_uri=http://apps.facebook.com/blogoauthgraph/
    &amp;scope=publish_stream,user_photos,user_photo_video_tags</pre>
<p>&#8230; where facebook authorized your app and redirects back to the:</p>
<pre class="brush: plain; title: ; notranslate">http://apps.facebook.com/blogoauthgraph/
    ?session=123456...</pre>
<p>&#8230; where session was valid access_token.</p>
<p><span id="more-1998"></span></p>
<p>Since today the mechanism changed into something like this:</p>
<pre class="brush: plain; title: ; notranslate">https://graph.facebook.com/oauth/authorize
    ?client_id=268718683475
    &amp;redirect_uri=http://apps.facebook.com/blogoauthgraph/
    &amp;scope=publish_stream,user_photos,user_photo_video_tags</pre>
<p>&#8230; redirects you to the:</p>
<pre class="brush: plain; title: ; notranslate">http://apps.facebook.com/blogoauthgraph/
    ?code=2.YndguK...</pre>
<p>&#8230; while you do not have valid session (access_token), you have to do the following request:</p>
<pre class="brush: plain; title: ; notranslate">https://graph.facebook.com/oauth/access_token
    ?client_id=268718683475
    &amp;redirect_uri=http://apps.facebook.com/blogoauthgraph/
    &amp;client_secret=YOURSECRET
    &amp;code=2.YndguK...</pre>
<p>&#8230; now facebook responds with:</p>
<pre class="brush: plain; title: ; notranslate">access_token=268718683475|2.Yndgu...&amp;expires=86183</pre>
<p>Notice, this is the response, not the redirect! Now its time to grab the access_token and use it in your app. This change has direct impact on <a href="http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/">Authorizing Iframe Facebook Applications For Graph API</a> article.</p>
<p>There have also been some other unannounced changes e.g. in facebook app settings in migrations tab &#8220;Remove fb_sig&#8221; toggler&#8230;</p>
<p>Credits goes to my readers Adam Cousins, <a href="http://davidbardos.com/">David Bardos</a>, Garcimore, <a href="http://www.etiennelescot.fr/">Etienne</a> for noticing the changes.</p>
<p>I have just spotted quick fix. All you need to do is add type=user_agent into your auth request:</p>
<pre class="brush: plain; title: ; notranslate">https://graph.facebook.com/oauth/authorize
    ?client_id=268718683475
    &amp;redirect_uri=http://apps.facebook.com/blogoauthgraph/
    &amp;scope=publish_stream,user_photos,user_photo_video_tags
    &amp;type=user_agent</pre>
<p>&#8230; now facebook redirects you to:</p>
<pre class="brush: plain; title: ; notranslate">http://apps.facebook.com/blogoauthgraph/
    ?access_token=123456...
    &amp;expires_in=86729</pre>
<p>This token is valid! I have updated the <a href="http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/">article</a> with this quickfix.</p>
<p>updated Jul 22, 2010: Facebook rollbacked the change and added &#8220;Canvas Session Parameter&#8221; parameter in facebook app settings / Migrations tab. With this setting enabled, your apps should work normally as they previously did.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/07/neverending-facebook-api-change/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Extending FacebookOAuthGraph Class</title>
		<link>http://blog.yoz.sk/2010/06/extending-facebookoauthgraph-class/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=extending-facebookoauthgraph-class</link>
		<comments>http://blog.yoz.sk/2010/06/extending-facebookoauthgraph-class/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 10:03:06 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[callback]]></category>
		<category><![CDATA[Callbacks]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FacebookOAuthGraph]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=1854</guid>
		<description><![CDATA[While The Facebook Graph API article becomes pretty popular and a lot of developers keep asking me to publish some practices I use, I managed to create this blog post. Here is a list o some functions you may want to extend FacebookOAuthGraph Class with. Extending &#38; Singletonize First, lets make our class singleton, so [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/auth-dialog-example.jpg" alt="" title="auth-dialog-example" width="200" height="100" class="alignleft size-full wp-image-1562" /></p>
<p>While <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/">The Facebook Graph API article</a> becomes pretty popular and a lot of developers keep asking me to publish some practices I use, I managed to create this blog post. Here is a list o some functions you may want to extend <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/">FacebookOAuthGraph</a> Class with.</p>
<p><span id="more-1854"></span></p>
<h3>Extending &amp; Singletonize</h3>
<p>First, lets make our class <a href="http://blog.yoz.sk/2009/10/actionscript-singleton-pattern/">singleton</a>, so the whole flash project can simply access and use one instance</p>
<pre class="brush: as3; title: ; notranslate">public class Facebook extends FacebookOAuthGraph
{
    private static const _instance:Facebook = new Facebook();
    public function Facebook()
    {
        super();
        useSecuredPath = true;
        if(instance)
            throw new Error(&quot;Use Facebook.instance!&quot;);
    }

    public static function get instance():Facebook
    {
        return _instance;
    }
    ....
}</pre>
<p>Now anywhere in your project:</p>
<pre class="brush: as3; title: ; notranslate">var facebook:Facebook = Facebook.instance;</pre>
<h3>Auto Execution After Authorization:</h3>
<p>Lets say, when user clicks on publish post before your application is connected, just make connect() followed by desired function:</p>
<pre class="brush: as3; title: ; notranslate">if(!facebook.authorized)
    facebook.connect();
facebook.publishPost(...)</pre>
<p>publishPost() automatically executes again after connected thanks to <a href="http://blog.yoz.sk/2010/06/callbacks-class-to-store-your-wishes-in-time/">Callbacks</a> class</p>
<pre class="brush: as3; title: ; notranslate">import sk.yoz.utils.Callbacks;

private function onAuthorized(event:FacebookOAuthGraphEvent):void
{
	Callbacks.execute(&quot;FBstuff&quot;);
}

public function publishPost(...):void
{
    if(!authorized)
        return Callbacks.add(this, arguments.callee, arguments, &quot;FBstuff&quot;);

    // here continues the function code
    ...
}</pre>
<h3>Application Friends</h3>
<p>Lets get list of friends using the application:</p>
<pre class="brush: as3; title: ; notranslate">private function getAppFriends():void
{
	var data:URLVariables = new URLVariables();
	data.query = &quot;SELECT uid, name, pic_square &quot; +
			&quot;FROM user &quot; +
			&quot;WHERE uid IN &quot; +
				&quot;(SELECT uid2 FROM friend WHERE uid1=&quot; + me.id + &quot;) &quot; +
				&quot;AND is_app_user&quot;;

	var loader:URLLoader = call(&quot;method/fql.query&quot;, data,
		URLRequestMethod.POST, null, &quot;https://api.facebook.com&quot;);
	loader.addEventListener(FacebookOAuthGraphEvent.DATA, onGetAppFriends);
}

private function onGetAppFriends(event:FacebookOAuthGraphEvent):void
{
	var xml:XML = new XML(event.rawData);
	var ns:Namespace = xml.namespace();
	default xml namespace = ns;
	xml.namespace(ns.prefix);
	xml.ignoreWhite = true;
	for each(var user:XML in xml.user)
	{
		user.uid.toString();
        user.name.toString();
		...
    }
    default xml namespace = new Namespace(&quot;&quot;);
}</pre>
<h3>Publishing Feeds</h3>
<p>Publish feed with image:</p>
<pre class="brush: as3; title: ; notranslate">public function publishPost(message:String, attachmentName:String,
	attachmentDescription:String):void
{
	var media:Object = {};
	media.src = &quot;http://mydomain.com/feedimage.jpg&quot;;
	media.href = &quot;http://apps.facebook.com/myapp&quot;;
	media.type = &quot;image&quot;;

	var attachment:Object = {};
	attachment.name = attachmentName;
	attachment.href = &quot;http://apps.facebook.com/myapp&quot;;
	attachment.description = attachmentDescription;
	//attachment.caption = &quot;test caption&quot;;
	attachment.media = [media];

	var data:URLVariables = new URLVariables();
	data.message = message;
	data.attachment = JSON.encode(attachment);

	call(&quot;method/stream.publish&quot;, data, URLRequestMethod.POST,
		null, &quot;https://api.facebook.com&quot;);
}</pre>
<p>Publish feed with flash:</p>
<pre class="brush: as3; title: ; notranslate">public function publishFlash(message:String, href:String, swfSrc:String,
	mediaSrc:String, attachmentName:String, attachmentCaption:String,
	attachmentDescription:String, properties:Object=null):void
{
	var media:Object = {};
	media.type = &quot;flash&quot;;
	media.swfsrc = swfSrc;
	media.imgsrc = mediaSrc;
	//media.width = &quot;80&quot;;
	//media.height = &quot;80&quot;;
	media.expanded_width = &quot;460&quot;;
	media.expanded_height = &quot;460&quot;;

	var attachment:Object = {};
	attachment.name = attachmentName;
	attachment.href = href;
	attachment.caption = attachmentCaption;
	attachment.description = attachmentDescription;
	attachment.media = [media];
	attachment.properties = properties; // action links
	// properties {prop1:{text: &quot;value 1&quot;, href:&quot;http://&quot;}, prop2:...};

	var data:URLVariables = new URLVariables();
	data.message = message;
	data.attachment = JSON.encode(attachment);

	call(&quot;method/stream.publish&quot;, data, URLRequestMethod.POST, null,
		&quot;https://api.facebook.com&quot;);
}</pre>
<p>Publish feed with action links:</p>
<pre class="brush: as3; title: ; notranslate">var properties:Object = {};
properties.MOVE = {
	text: &quot;mouse drag&quot;,
	href:config.urlManager.boardURL};
properties.ZOOM = {
	text: &quot;double click, [Page Up], [Page Down]&quot;,
	href:config.urlManager.boardURL};
properties.ROTATE = {
	text: &quot;[Ctrl] + mouse move&quot;,
	href:config.urlManager.boardURL};

attachment.properties = properties;</pre>
<p>Publishing feed using Graph API (<a href="http://developers.facebook.com/docs/api#publishing">docs</a>, from <a href="http://bugs.developers.facebook.net/show_bug.cgi?id=10672">facebook bugzilla</a>):</p>
<ul>
<li>forget everything related to the old &#8220;media&#8221; stuff of the attachment</li>
<li>put what you had in <del datetime="2010-09-09T14:01:25+00:00">swfsrc</del> into <strong>source</strong> (mandatory)</li>
<li>put what you had in <del datetime="2010-09-09T14:01:25+00:00">imgsrc</del> into <strong>picture</strong> (mandatory)</li>
<li><strong>link</strong> is mandatory also and must points to the connect or canvas URL</li>
<li>Feed arguments: message, picture, link, name, caption, description, source</li>
</ul>
<h3>Uploading Photo</h3>
<p>This is a piece of working code from <a href="http://www.seanhak.net/">Sean</a>, more <a href="http://blog.yoz.sk/examples/FacebookOAuthGraph/as/uploadImage.as">upload handling functions and album creating</a> can be found here. thnx Sean:</p>
<pre class="brush: as3; title: ; notranslate">// MultipartURLLoader by Eugene Zatepyakin can be found here: http://bit.ly/9wx4q7
public function uploadImageCall(bytes:ByteArray, message:String):MultipartURLLoader
{
    var mpLoader:MultipartURLLoader = new MultipartURLLoader();
    mpLoader.addVariable(&quot;message&quot;, message);
    mpLoader.addFile(bytes, &quot;image.jpg&quot;, &quot;image&quot;);
    loaderAddListeners(mpLoader.loader);
    mpLoader.load(apiSecuredPath + &quot;/me/photos?access_token=&quot;+ token);
    return mpLoader;
}</pre>
<h3>Palming Token</h3>
<p>When localy debuging your app you may want to palm off custom access_token:</p>
<pre class="brush: as3; title: ; notranslate">if(parameters.debug)
    facebook.hackToken(parameters, &quot;110363ABXY...&quot;); // copypaste from callback.html hash
facebook.autoConnect(parameters);</pre>
<p>in Facebook.as:</p>
<pre class="brush: as3; title: ; notranslate">public function hackToken(parameters:Object, token:String):Object
{
	if(!parameters.session)
		parameters.session = JSON.encode({
			access_token:String(token).replace(/\%7C/g, &quot;|&quot;)});
	return parameters;
}</pre>
<h3>Advanced Crossdomain Working Authorization</h3>
<p>Or if you prefer or need advanced callback, that works crossdomain, and also for local debuging: callback.html</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;sk&quot; lang=&quot;sk&quot; dir=&quot;ltr&quot;&gt;
&lt;head&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;js/swfobject.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	&lt;!--
		if(window.opener &amp;&amp; window.opener.confirmFacebookConnection){
			window.opener.confirmFacebookConnection(window.location.hash);
			self.close();
		}else{
			var flashvars = {};
			flashvars.connectionName = &quot;_facebookConnector&quot;;
			flashvars.methodName = &quot;confirmConnection&quot;;
			flashvars.hash = window.location.hash;

			swfobject.embedSWF(&quot;flash/Callback.swf&quot;, &quot;flash&quot;, &quot;1&quot;, &quot;1&quot;, &quot;10.0.0&quot;,
				&quot;expressInstall.swf&quot;, flashvars, {}, {});
		}
	//--&gt;
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;p&gt;You may now close this window.&lt;/p&gt;
	&lt;div id=&quot;flash&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>universal <a href="http://blog.yoz.sk/examples/FacebookOAuthGraph/Callback.swf">callback.swf</a> (741 Bytes) main class:</p>
<pre class="brush: as3; title: ; notranslate">package
{
    import flash.display.Sprite;
    import flash.net.LocalConnection;

    public class Callback extends Sprite
    {
        public function Callback()
        {
            super();
            var parameters:Object = loaderInfo.parameters
            var localConnection:LocalConnection = new LocalConnection();
            localConnection.send(
                parameters.connectionName,
                parameters.methodName,
                parameters.hash);
        }
    }
}</pre>
<p>facebook.as class:</p>
<pre class="brush: as3; title: ; notranslate">private var localConnection:LocalConnection;

override public function connect():void
{
	super.connect();

	if(!localConnection)
	{
		localConnection = new LocalConnection();
		localConnection.client = this;
		localConnection.allowDomain(&quot;*&quot;);
		localConnection.allowInsecureDomain(&quot;*&quot;);
		localConnection.connect(&quot;_facebookConnector&quot;);
	}
}

private function onAuthorized(event:FacebookOAuthGraphEvent):void
{
	// listener defined in Facebook constructor:
	// addEventListener(FacebookOAuthGraphEvent.AUTHORIZED, onAuthorized);

	try
	{
		localConnection.close();
		localConnection = null;
	}
	catch(error:Error){}
}</pre>
<h3>Getting All The Photos Of All Albums Of 1 User</h3>
<p>Credits to <a href="http://www.etiennelescot.fr/">Etienne</a>, thnx</p>
<pre class="brush: as3; title: ; notranslate">function getAllphotos(uid:String):void {
	var data:URLVariables = new URLVariables();
	data.query = &quot;SELECT src_small, src_big &quot; +
		&quot;FROM photo &quot; +
		&quot;WHERE aid IN ( SELECT aid FROM album WHERE owner='&quot;+HERE PUT THE USER ID+&quot;' )&quot;
	var loader:URLLoader = facebook.call(&quot;method/fql.query&quot;, data,URLRequestMethod.POST,
		null, &quot;https://api.facebook.com&quot;);
	loader.addEventListener(FacebookOAuthGraphEvent.DATA, onGetAllphotos);
}</pre>
<h3>Tagging photos</h3>
<p>This script uses <a href="http://developers.facebook.com/docs/reference/rest/photos.addTag">photos.addTag</a> &#8211; part of old REST api (some <a href="http://blog.yoz.sk/2010/06/extending-facebookoauthgraph-class/#comment-3504">more reading</a>):</p>
<pre class="brush: as3; title: ; notranslate">var data:URLVariables = new URLVariables();
data.pid = photoID;
data.tag_uid = userID; // user on photo we are tagging
data.x = 50; // 50% means center
data.y = 50; // 50% means middle
call(&quot;method/photos.addTag&quot;, data, URLRequestMethod.GET, null, &quot;https://api.facebook.com&quot;);</pre>
<p>Important: Graph API upload call returns the object_id. In order to get pid you have to lookup in photo table:</p>
<pre class="brush: sql; title: ; notranslate">SELECT pid FROM photo WHERE object_id=response.id</pre>
<h3>Catching verify token error</h3>
<p>In order to catch the ERROR event with verifyToken() method <a href="http://dndigital.net/">Nils</a> <a href="http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/#comment-3042">suggested</a> the following:</p>
<pre class="brush: as3; title: ; notranslate">override public function verifyToken(token:String):URLLoader
{
    var loader:URLLoader = super.verifyToken(token);
    loader.addEventListener(FacebookOAuthGraphEvent.ERROR,
        function(event:FacebookOAuthGraphEvent):void
        {
            _authorized = false;
            _me = null;
            _token = null;
            EventDispatcher(event.currentTarget)
                .removeEventListener(event.type, arguments.callee);
            var type:String = FacebookOAuthGraphEvent.UNAUTHORIZED;
            dispatchEvent(new FacebookOAuthGraphEvent(type));
        });
    return loader;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/06/extending-facebookoauthgraph-class/feed/</wfw:commentRss>
		<slash:comments>129</slash:comments>
		</item>
		<item>
		<title>Authorizing Iframe Facebook Applications For Graph API</title>
		<link>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=authorizing-iframe-facebook-applications-for-graph-api</link>
		<comments>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 11:48:09 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Access Token]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FacebookOAuthGraph]]></category>
		<category><![CDATA[Graph API]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=1732</guid>
		<description><![CDATA[This article continues my exploration of best facebook graph api integration into your flash app. Before continue reading, make sure you understand the previous article. Due to huge interest, I am adding codes that makes your flash app working with graph api within facebook iframe. Try this app live on http://apps.facebook.com/blogoauthgraph/, notice once you get [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/auth-dialog-example.jpg" alt="" title="auth-dialog-example" width="200" height="100" class="alignleft size-full wp-image-1562" /></p>
<p>This article continues my exploration of best facebook graph api integration into your flash app. Before continue reading, make sure you understand the <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/">previous article</a>. Due to huge interest, I am adding codes that makes your flash app working with graph api within facebook iframe. Try this app live on <a href="http://apps.facebook.com/blogoauthgraph/">http://apps.facebook.com/blogoauthgraph/</a>, notice once you get there, you are redirected to grant permissions (if not authorized or granted already) and then redirected back to the app, where you are connected and ready to use graph api.</p>
<p><span id="more-1732"></span></p>
<p>What I did was changing one line of ActionScript, I added autoConnect() methods that sends app flashvars directly into <a href="http://classes.yoz.sk/sk/yoz/net/FacebookOAuthGraph.as">FacebookOAuthGraph</a> object.</p>
<pre class="brush: as3; title: ; notranslate">var facebook:FacebookOAuthGraph = new FacebookOAuthGraph();
...
facebook.autoConnect(parameters); // passing flashvars</pre>
<p>See <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/">full ActionScript code</a> for details.</p>
<p>Now there is a different html wrapper for facebook iframe &#8211; facebook.php:</p>
<pre class="brush: php; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;cs&quot; xml:lang=&quot;cs&quot;&gt;
&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
    &lt;meta http-equiv=&quot;Content-language&quot; content=&quot;cs&quot; /&gt;
    &lt;title&gt;FacebookOAuthGraphTest&lt;/title&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;js/swfobject.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
        //&lt;![CDATA[
		function allRequestParameters()
		{
			var data = {};
			var strHref = window.location.href;
			if ( strHref.indexOf(&quot;?&quot;) &gt; -1 ) {
				var strQueryString = strHref.substr(strHref.indexOf(&quot;?&quot;)+1);
				var aQueryString = strQueryString.split(&quot;&amp;&quot;);
				for ( var iParam = 0; iParam &lt; aQueryString.length; iParam++ ) {
					var aParam = aQueryString[iParam].split(&quot;=&quot;);
					data[aParam[0]] = aParam[1];
				}
			}
			return data;
		}

		function generateFlash()
		{
			var flashvars = allRequestParameters();
			flashvars.session = '{&quot;access_token&quot;:&quot;' + signed_request.oauth_token + '&quot;}';

			var params = {
				allowScriptAccess: &quot;sameDomain&quot;
			};

			var attributes = {
				id: &quot;FacebookOAuthGraphTest&quot;,
				name: &quot;FacebookOAuthGraphTest&quot;
			};

			swfobject.embedSWF(&quot;FacebookOAuthGraphTest.swf?v=2&quot;, &quot;alternative&quot;, &quot;100%&quot;, &quot;100%&quot;, &quot;10.0.0&quot;,
				&quot;expressInstall.swf&quot;, flashvars, params, attributes);
		}

		&lt;?php
		$signed_request = $_REQUEST[&quot;signed_request&quot;];
		list($encoded_sig, $payload) = explode('.', $signed_request, 2);
		$data = base64_decode(strtr($payload, '-_', '+/'));
		echo &quot;var signed_request=&quot; . $data . &quot;;&quot;;
		?&gt;

		if(!signed_request.oauth_token){
			window.top.location = &quot;https://www.facebook.com/dialog/oauth&quot;
				+ &quot;?client_id=&quot; + '268718683475'
				+ &quot;&amp;redirect_uri=&quot; + 'http://apps.facebook.com/blogoauthgraph/'
				+ &quot;&amp;scope=publish_stream,user_photos,user_photo_video_tags&quot;
				+ &quot;&amp;response_type=token&quot;;
		}else{
			generateFlash();
		}
        //]]&gt;
    &lt;/script&gt;
    &lt;style&gt;
        body {margin:0px;overflow:hidden}
        html, body, object, embed {width:100%;height:100%;outline:none;}
    &lt;/style&gt;
 &lt;/head&gt;
 &lt;body style=&quot;text-align:center;&quot;&gt;
    &lt;div id=&quot;alternative&quot;&gt;
        &lt;a href=&quot;http://www.adobe.com/go/getflashplayer&quot;&gt;
            &lt;img src=&quot;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&quot; alt=&quot;Get Adobe Flash player&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>There are few lines of code to be mentioned:</p>
<ul>
<li><del datetime="2011-03-16T08:55:15+00:00">getRequestParameter(name) &#8211; returns GET parameter from iframe url, you can use your own functions</del></li>
<li>allRequestParameters() &#8211; returns object consisting of all iframe GET parameters, used to pass flashvars into our flash</li>
<li>php code to define javascript signed_request variable containing valid token</li>
<li>window.top.location &#8211; if there is no token parameter found (not authorized yet), you are redirected to the facebook authorization. Do not forget to change <strong>client_id</strong> and <strong>redirect_uri</strong> when using for your app.</li>
</ul>
<p>Facebook settings:</p>
<pre class="brush: plain; title: ; notranslate">App ID: 268718683475
Site URL: http://blog.yoz.sk/examples/FacebookOAuthGraph/
Site Domain: yoz.sk
Canvas Page: http://apps.facebook.com/blogoauthgraph/
Canvas URL: http://blog.yoz.sk/examples/FacebookOAuthGraph/facebook.php?a=b
Canvas FBML/iframe: iframe

Disable Deprecated Auth Methods: Enabled
Stream post URL security: Disabled
OAuth 2.0 for Canvas: Enabled
POST for Canvas: Enabled
Canvas Session Parameter (Deprecated): Disabled
November 2010 Rollup: Enabled
Timezone-less events: Enabled
Upgrade to Requests 2.0: Enabled
JSON Encoding Empty Arrays: Enabled</pre>
<p>Here is the final facebook app <a href="http://apps.facebook.com/blogoauthgraph/">http://apps.facebook.com/blogoauthgraph/</a></p>
<p><del datetime="2011-03-16T08:55:15+00:00">updated Jul 21, 2010: Quickfix for late facebook changes:</del></p>
<p><del datetime="2011-03-16T09:07:55+00:00">updated Jul 22, 2010: Facebook rollbacked the change and added &#8220;Canvas Session Parameter&#8221; parameter in facebook app settings / Migrations tab. With this setting enabled, your apps should work normally as they previously did.</del></p>
<p>updated Mar 16, 2011: Catching token from POST parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/feed/</wfw:commentRss>
		<slash:comments>115</slash:comments>
		</item>
		<item>
		<title>Facebook Graph API &amp; OAuth 2.0 &amp; Flash (update)</title>
		<link>http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=facebook-graph-api-and-oauth-2-and-flash</link>
		<comments>http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/#comments</comments>
		<pubDate>Wed, 05 May 2010 15:04:22 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Access Token]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FacebookOAuthGraph]]></category>
		<category><![CDATA[Graph API]]></category>
		<category><![CDATA[OAuth]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=1560</guid>
		<description><![CDATA[As previously mentioned, facebook released a new Graph API. It is based on OAuth 2.0 protocol (old authorization token also works). While it is fresh thing, there is no much ActionScript stuff around, so I came with FacebookOAuthGraph class. This class is meant to be used as an abstract class, while it contains just the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/auth-dialog-example.jpg" alt="" title="auth-dialog-example" width="200" height="100" class="alignleft size-full wp-image-1562" /></p>
<p>As previously mentioned, <a href="http://blog.yoz.sk/2010/04/facebook-now-with-oauth-and-open-graph/">facebook released a new Graph API</a>. It is based on OAuth 2.0 protocol (old authorization token also works). While it is fresh thing, there is no much ActionScript stuff around, so I came with <a href="http://classes.yoz.sk/sk/yoz/net/FacebookOAuthGraph.as">FacebookOAuthGraph</a> class. This class is meant to be used as an abstract class, while it contains just the basic authentication algorithm and call method to request data. It stores access token in SharedObject, so next time you came into app, you get connected on background without noticing (no popup etc.). Your token should expire in 24 hours.</p>
<p><span id="more-1560"></span></p>
<p>Here is the code for the following flex app, to make it work, get latest <a href="http://classes.yoz.sk/sk/yoz/net/FacebookOAuthGraph.as">FacebookOAuthGraph</a> and <a href="http://classes.yoz.sk/sk/yoz/events/FacebookOAuthGraphEvent.as">FacebookOAuthGraphEvent</a> classes.</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot;
    applicationComplete=&quot;init()&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[

    import sk.yoz.events.FacebookOAuthGraphEvent;
    import sk.yoz.net.FacebookOAuthGraph;

    // facebook Application ID
    private var clientId:String = &quot;268718683475&quot;;

    // path to our callback
    private var redirectURI:String =
        &quot;http://blog.yoz.sk/examples/FacebookOAuthGraph/callback.html&quot;;

    // required extended permissions
    private var scope:String = &quot;publish_stream,user_photos,user_photo_video_tags&quot;;

    private var facebook:FacebookOAuthGraph = new FacebookOAuthGraph();

    [Bindable] private var connected:Boolean;

    private function init():void
    {
        facebook.clientId = clientId;
        facebook.redirectURI = redirectURI;
        facebook.scope = scope;
        facebook.useSecuredPath = true;
        facebook.addEventListener(FacebookOAuthGraphEvent.AUTHORIZED, authorized);

        // stage.root.loaderInfo.parameters
        facebook.autoConnect(parameters);

        log.text += &quot;checkSavedToken()\n&quot;;
    }

    private function connect():void
    {
        facebook.connect();

        log.text += &quot;connect()\n&quot;;
    }

    private function authorized(event:FacebookOAuthGraphEvent):void
    {
        connected = true;

        log.text += &quot;authorized\n&quot;;
    }

    private function call(path:String, binary:Boolean):void
    {
        var loader:URLLoader = facebook.call(path);
        loader.dataFormat = binary
            ? URLLoaderDataFormat.BINARY
            : URLLoaderDataFormat.TEXT;
        loader.addEventListener(FacebookOAuthGraphEvent.DATA, callComplete);
        log.text += &quot;call(&quot; + path + &quot;)\n&quot;;
    }

    private function changeStatus(message:String):void
    {
        var data:URLVariables = new URLVariables();
        data.message = message;
        var method:String = URLRequestMethod.POST;
        var loader:URLLoader = facebook.call(&quot;me/feed&quot;, data, method);
        loader.addEventListener(FacebookOAuthGraphEvent.DATA, callComplete);
        log.text += &quot;changeStatus(&quot; + message + &quot;)\n&quot;;
    }

    private function callComplete(event:FacebookOAuthGraphEvent):void
    {
        log.text += &quot;call completed -&gt; see result\n&quot;;

        if(event.rawData is ByteArray)
        {
            var loader:Loader = new Loader();
            loader.loadBytes(event.rawData as ByteArray);
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
                function():void
                {
                    image.source = loader;
                });
        }
        else
        {
            result.text = event.rawData.toString();
        }
    }
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:HBox&gt;
    &lt;mx:Button click=&quot;connect()&quot; label=&quot;connect&quot; /&gt;
    &lt;mx:Text text=&quot;{connected ? 'connected' : 'not connected'}&quot; /&gt;
&lt;/mx:HBox&gt;
&lt;mx:HBox visible=&quot;{!connected}&quot; includeInLayout=&quot;{!connected}&quot;&gt;
    &lt;mx:Text text=&quot;#access_token=121161974560905%7C2...&quot; /&gt;
    &lt;mx:TextInput id=&quot;hash&quot; /&gt;
    &lt;mx:Button label=&quot;add hash&quot; click=&quot;facebook.confirmConnection(hash.text)&quot;/&gt;
&lt;/mx:HBox&gt;
&lt;mx:HBox&gt;
    &lt;mx:TextInput id=&quot;path&quot; text=&quot;me&quot; /&gt;
    &lt;mx:Button label=&quot;call&quot; click=&quot;call(path.text, false)&quot; enabled=&quot;{connected}&quot;/&gt;
    &lt;mx:Spacer width=&quot;20&quot; /&gt;
    &lt;mx:TextInput id=&quot;path2&quot; text=&quot;me/picture&quot; /&gt;
    &lt;mx:Button label=&quot;call binary&quot; click=&quot;call(path2.text, true)&quot; enabled=&quot;{connected}&quot;/&gt;
&lt;/mx:HBox&gt;
&lt;mx:HBox&gt;
    &lt;mx:TextInput id=&quot;status&quot; text=&quot;testing FacebookOAuthGraph&quot; /&gt;
    &lt;mx:Button label=&quot;change status&quot; click=&quot;changeStatus(status.text)&quot; enabled=&quot;{connected}&quot;/&gt;
&lt;/mx:HBox&gt;
&lt;mx:HDividedBox width=&quot;100%&quot; height=&quot;100%&quot;&gt;
    &lt;mx:TextArea width=&quot;30%&quot; height=&quot;100%&quot; id=&quot;log&quot;/&gt;
    &lt;mx:TextArea width=&quot;70%&quot; height=&quot;100%&quot; id=&quot;result&quot;/&gt;
    &lt;mx:Image id=&quot;image&quot; /&gt;
&lt;/mx:HDividedBox&gt;
&lt;/mx:Application&gt;</pre>
<p>Make sure your html wrapper defines correct allowScriptAccess and both id and name for &lt;object&gt; tag. This enables ExternalInterface.objectID. With swfobject use:</p>
<pre class="brush: jscript; title: ; notranslate">var params = {
    allowScriptAccess: &quot;sameDomain&quot;
};

var attributes = {
    id: &quot;FacebookOAuthGraphTest&quot;,
    name: &quot;FacebookOAuthGraphTest&quot;
};
swfobject.embedSWF(&quot;FacebookOAuthGraphTest.swf&quot;, &quot;alternative&quot;, &quot;100%&quot;, &quot;100%&quot;, &quot;10.0.0&quot;,
    &quot;expressInstall.swf&quot;, flashvars, params, attributes);</pre>
<p>callback.html pushes url hash into flash app. When running this application from desktop (creating/debugging), your callback.html located on public domain has no access to its opener (different domain &#8211; XSS), so you need to pass access_token manualy into &lt;TextInput id=&#8221;hash&#8221;&gt;, but once your flash application is on the same domain with callback, it works automaticaly.</p>
<p>callback.html:</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;sk&quot; lang=&quot;sk&quot; dir=&quot;ltr&quot;&gt;
&lt;head&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	&lt;!--
		if(window.opener &amp;&amp; window.opener.confirmFacebookConnection)
		{
			window.opener.confirmFacebookConnection(window.location.hash);
			self.close();
		}
	//--&gt;
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;You may now close this window.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Click connect and allow facebook application. Facebook redirects to callback.html that pastes hash into flash and closes popup. Now you are authenticated. Next time you visit this flash application (refresh this page) you will get authenticated in background (if your access token is still valid). Notice, some graph api calls returns JSON objects (me), other may return binary data (me/picture). For now it may take some time to finish calls (5 second or more), but I hope facebook will soon make it fast.</p>
<p><iframe src="http://blog.yoz.sk/examples/FacebookOAuthGraph/" width="100%" height="500" style="border:none;"></iframe></p>
<p>You get your JSON decoded data via event.data. Just make sure you do not try to decode ByteArray (eg. me/picture)</p>
<pre class="brush: as3; title: ; notranslate">// call(&quot;me&quot;)
private function callComplete(event:FacebookOAuthGraphEvent):void
{
    trace(event.data.name);
}</pre>
<p>Some calls to test:</p>
<pre class="brush: plain; title: ; notranslate">Friends:             me/friends
News feed:           me/home
Profile feed (Wall): me/feed
Likes:               me/likes
Movies:              me/movies
Books:               me/books
Notes:               me/notes
Photos:              me/photos
Videos:              me/videos
Events:              me/events
Groups:              me/groups</pre>
<p>Additional information about my facebook app (see <a href="http://blog.yoz.sk/examples/FacebookOAuthGraph/settings.png">all settings</a>):</p>
<pre class="brush: plain; title: ; notranslate">Application ID:         268718683475
App Domain:              yoz.sk
Website / Site URL:      http://blog.yoz.sk/examples/FacebookOAuthGraph/
App on FB / Canvas URL:  http://blog.yoz.sk/examples/FacebookOAuthGraph/facebook.php?a=b
Page Tab / Page Tab URL: http://blog.yoz.sk/examples/FacebookOAuthGraph/facebook.html?
Canvas type:             iframe
Developer Mode:          Off
App Type:                Native/Desktop
Sandbox Mode:            Disabled
Remove Deprecated APIs:  Enabled
signed_request for Canvas: Enabled
Timezone-less events:    Enabled
Encrypted Access Token:  Enabled
...other Migrations:     Disabled</pre>
<p>Based on facebook access token, it should be valid approximately for 24 hours. Notice the bold part, works as expiration time (unix time format). Use FacebookOAuthGraph.tokenToExpiration() to parse Date:</p>
<p>access_token=268718683475%7C2.w3fjqz80Xi1CdBXt7Ygh6A__.86400.<strong><em>1273158000</em></strong>-1215645368%7CDGv2l2HtTymd6cM6Fy_8k6P_8CQ.</p>
<p><strong>Important update:</strong> May 19, 2010: Application is working again. Due to <a href="http://bugs.developers.facebook.com/show_bug.cgi?id=10055">massive support in bug tracker</a> (thanks all for your votes), facebook devs changed secured <a href="https://graph.facebook.com/crossdomain.xml">crossdomain.xml</a>, so it allows unsecured requests. changeStatus() method added into example and some minor changes in FacebookOAuthGraph class (please update).</p>
<p>Here is what happend and why this app was not working for a while:</p>
<ul>
<li>May 11, 2010: facebook changed rules, so requests on unsecured graph service (via http://graph.facebook.com&#8230;) were limited to just those without access_token parameter. Requets to secured service (https://graph.facebook.com) resulted in security violation due to missing secure=&#8221;false&#8221; parameter in <a href="https://graph.facebook.com/crossdomain.xml">crossdomain.xml</a></li>
<li>May 12, 2010: <a href="http://bugs.developers.facebook.com/show_bug.cgi?id=10055">bug submitted</a></li>
<li>May 12, 2010 &#8211; May 14, 2010: massive bug voting</li>
<li>May 14, 2010: Bug confirmed by facebook dev team</li>
<li>May 19, 2010: Bug fixed, crossdomain file changed</li>
</ul>
<p>I am glad that facebook devs listens and care. <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>FAQ</h2>
<h3>Is there a .fla version available?</h3>
<p>Yes, there is a simple working Flash CS4 <a href="http://blog.yoz.sk/examples/FacebookOAuthGraph/src/cs4.zip">archive available for download (.fla + all sources)</a>. The demo connects the facebook application and once connected, it uploads generated picture into photo album.</p>
<h3>How can I use this class in my iframe canvas page?</h3>
<p>Please read article <a href="http://blog.yoz.sk/2010/06/authorizing-iframe-facebook-applications-for-graph-api/">Authorizing Iframe Facebook Applications For Graph API</a></p>
<h3>How can I make this class do more advanced things and what are the best practices?</h3>
<p>Please read article <a href="http://blog.yoz.sk/2010/06/extending-facebookoauthgraph-class/">Extending FacebookOAuthGraph Class</a>, where all the most comon extendings are described.</p>
<h3>When I connect with this app in one browser (firefox), and I run another browser (chrome) I get automatically connected. Why?</h3>
<p>Your authorization token is stored in SharedObject, that is OS-user persistent (eg. windows user). No matter what browser you run, all of those reads data from one SharedObject. If you need cookie or session persistent authorization, please extend my class and override methods that use SharedObject.</p>
<h3>How to add request parameters into my call?</h3>
<p>Pass URLVariables object as a second parameter to call() method:</p>
<pre class="brush: as3; title: ; notranslate">// eg. in order to make this call &quot;me/picture?type=large&quot;, do the following:
var data:URLVariables = new URLVariables();
data.type = &quot;large&quot;
call(&quot;me/picture&quot;, data);</pre>
<h3>Why I can not access me/photos?</h3>
<p>Facebook has changed rules again. You also need &#8220;user_photo_video_tags&#8221; permission within your app. I have already added it into my app, so please remove your browser cache, refresh and click connect button again (even if you are connected already). Now it should work.</p>
<h3>How to upload photo with graph api?</h3>
<p>This is a piece of working code from <a href="http://www.seanhak.net/">Sean</a>, thnx Sean:</p>
<pre class="brush: as3; title: ; notranslate">// MultipartURLLoader by Eugene Zatepyakin can be found here: http://bit.ly/9wx4q7
public function uploadImageCall(path:String, ba:ByteArray, message:String, token:String=null):MultipartURLLoader
{
    var mpLoader:MultipartURLLoader = new MultipartURLLoader();
    mpLoader.addVariable(&quot;message&quot;, message);
    mpLoader.addFile(ba, &quot;image.jpg&quot;, &quot;image&quot;);
    loaderAddListeners(mpLoader.loader);
    mpLoader.load(apiSecuredPath + &quot;/me/photos?access_token=&quot;+ token);
    return mpLoader;
}</pre>
<h3>Can I make fql calls with this class?</h3>
<p>However graph api does not implement fql calls, you can make fql calls using this class. The resulted data are not JSON but XML:</p>
<pre class="brush: as3; title: ; notranslate">var data:URLVariables = new URLVariables();
data.query = &quot;SELECT uid, name FROM user WHERE uid = XXX&quot;; // insert your uid
var loader:URLLoader = facebook.call(&quot;method/fql.query&quot;, data,
    URLRequestMethod.POST, null, &quot;https://api.facebook.com&quot;);
loader.addEventListener(FacebookOAuthGraphEvent.DATA, fqlComplete);

private function fqlComplete(event:FacebookOAuthGraphEvent):void{
        var xml:XML = new XML(event.rawData);</pre>
<p>For fqlComplete method, please read <a href="http://blog.yoz.sk/2010/01/parsing-fql-result/">Parsing FQL result</a> article.</p>
<h3>Can I post feeds with attachments?</h3>
<p>Graph API has not documented attachment functionality for feeds, anyway, you can publish streams with attachments with this class as simple as:</p>
<pre class="brush: as3; title: ; notranslate">var media:Object = {};
media.type = &quot;flash&quot;;
media.swfsrc = &quot;http://zombo.com/inrozxa.swf&quot;;
media.imgsrc = &quot;http://blog.yoz.sk/wp-content/uploads/3d-150x150.jpg&quot;;
media.width = &quot;80&quot;;
media.height = &quot;80&quot;;
media.expanded_width = &quot;120&quot;;
media.expanded_height = &quot;120&quot;;

var attachment:Object = {};
attachment.name = &quot;test name&quot;;
attachment.href = &quot;http://blog.yoz.sk&quot;
attachment.description = &quot;test description&quot;;
attachment.caption = &quot;test caption&quot;;
attachment.media = [media];

var data:URLVariables = new URLVariables();
data.message = &quot;test message&quot;;
data.attachment = JSON.encode(attachment);

facebook.call(&quot;method/stream.publish&quot;, data, URLRequestMethod.POST, null, &quot;https://api.facebook.com&quot;);</pre>
<h3>How can I develop my app locally when callback only works on the domain?</h3>
<p>While callback is not able to push access_token into your app on runtime, I just copy access_token value into my code and publish again:</p>
<pre class="brush: as3; title: ; notranslate">if(!parameters.session)
parameters.session = JSON.encode({
    access_token:String(&quot;123864964303507%7C2._pSS7WlemeGB9M0RV8Vnuw__.3600.1276246800-1215645368%7C-kYjWPx4MR6DXc5Clcnv5kXX3t4.&quot;)
        .replace(/\%7C/g, &quot;|&quot;)
});
facebook.autoConnect(parameters);</pre>
<h3>Hi Is there a way to implement a “i Like” button with your class?</h3>
<p>Sorry, you can not use graph API to like stuff, there is no method for that. Even by testing like request:</p>
<pre class="brush: plain; title: ; notranslate">href: http://www.facebook.com/pages/***
node_type: page
edge_type: like
page_id: 12345
action_text
now_connected: true
nctr[_mod]: connect
post_form_id: 123ABF***********
fb_dtsg: TAfAJ
post_form_id_source: AsyncRequest</pre>
<p>&#8230; post_form_id is some static required parameter that you can not guess.</p>
<h3>This example app works with Internet Explorer, but my one results in Error #2032</h3>
<p><del datetime="2010-08-04T08:05:14+00:00">Please complie your app to Flash Player 10 (or later). It should fix this issue. Credits goes to Garcimore <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> , thnx</del>. The issue has been identified as <a href="http://bugs.developers.facebook.com/show_bug.cgi?id=10631">header Content-Type: application/json</a>, that is returned from facebook. Suggested workaround (by facebook dev team) is to use POST variables with your requests, however <a href="#comment-2737">it is reported as not working solution</a>. </p>
<h3>I can not make it run in my Mac-Safari sonfiguration</h3>
<p>It seems there is a bug in Safari on Mac that does not let you open popup via ExternalInterface. You should use navigateToURL() in that case. Credits goes to Beans, thank you. <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/#comment-3125">More instructions here</a>.</p>
<pre class="brush: as3; title: ; notranslate">var js:String = &quot;return window.navigator.userAgent.indexOf('Safari') &gt; -1);&quot;
if(ExternalInterface.call(&quot;function(){&quot; + js + &quot;}&quot;)){
   // safari specific code</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/feed/</wfw:commentRss>
		<slash:comments>433</slash:comments>
		</item>
		<item>
		<title>Facebook now with OAuth and Open Graph (update)</title>
		<link>http://blog.yoz.sk/2010/04/facebook-now-with-oauth-and-open-graph/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=facebook-now-with-oauth-and-open-graph</link>
		<comments>http://blog.yoz.sk/2010/04/facebook-now-with-oauth-and-open-graph/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 09:11:20 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technologies]]></category>
		<category><![CDATA[F8]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Open Graph]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=1462</guid>
		<description><![CDATA[Few days before while I was working on TwitterLogger Class for ActionScript 3 I discovered OAuth &#8211; an open protocol to allow secure API authorization . While reading all the stuff about OAuth and PHP SDKs, I noticed one statement somewhere (can&#8217;t find it nowhere) that Facebook was in fact using OAuth for its Facebook [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/openGraph-200x100.png" alt="" title="openGraph" width="200" height="100" class="alignleft size-medium wp-image-1474" /></p>
<p>Few days before while I was working on <a href="http://blog.yoz.sk/2010/04/twitterlogger-class-to-full-twitter-api-access-from-actionscript-3/">TwitterLogger Class for ActionScript 3</a> I discovered <a href="http://oauth.net/">OAuth &#8211; an open protocol to allow secure API authorization</a> . While reading all the stuff about OAuth and PHP SDKs, I noticed one statement somewhere (can&#8217;t find it nowhere) that Facebook was in fact using OAuth for its Facebook Connect tool but some derived version. This has now changed! Facebook is standardizing communication and authorization by introducing <strong>Open Graph</strong> and <strong>OAtuh 2.0</strong>.</p>
<p><span id="more-1462"></span></p>
<p><a href="http://www.facebook.com/f8">F8</a> is a Facebook conference to bring together the developers and entrepreneurs who are building the social Web by moving fast, taking risks, and hacking traditional systems. In <a href="http://mashable.com/2010/04/21/facebook-f8-2/">April 21, 2010, in F8 conference</a> a few interesting things have been mentioned about the new Facebook API. Facebook CEO Mark Zuckerberg announced that the Facebook Connect brand would be eliminated as part of the launch of <a href="http://mashable.com/2010/04/21/facebook-open-graph/">Open Graph</a>.</p>
<p>Update (May 5, 2010): I have created <a href="http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/"><strong>Facebook Graph API &#038; OAuth 2.0 &#038; Flash</strong></a> &#8211; FacebookOAuthGraph ActionScript 3 class to use with OAuth 2.0 and Graph</p>
<h3>Open Graph</h3>
<blockquote><p>The Open Graph API will allow any page on the Web to have all the features of a Facebook Page – users will be able to become a Fan of the page, it will show up on that user’s profile and in search results, and that page will be able to publish stories to the stream of its fans. (<a href="http://wiki.developers.facebook.com/index.php/Roadmap_Open_Graph_API">Facebook Roadmap Open Graph API</a>)</p></blockquote>
<p><a href="http://developers.facebook.com/docs/opengraph">Open Graph protocol</a> also introduces &lt;meta&gt; tags, that allows you to specify structured information about your web page when used with like button etc.</p>
<p>Here are some url examples of <a href="http://developers.facebook.com/docs/reference/api/">Graph API</a> usage:</p>
<pre class="brush: plain; title: ; notranslate">http://graph.facebook.com/[USERID]          - user’s graph for your app
http://graph.facebook.com/[USERID]/friends  - access to user’s friends
http://graph.facebook.com/[USERID]/likes    - access user’s likes</pre>
<p>By default these requests return JSON objects, but I guess there is a parameter to be passed to get xml instead (my guess).</p>
<p>Cool thing about this is there is a benevolent crossdomain file on <a href="http://graph.facebook.com/crossdomain.xml">http://graph.facebook.com/crossdomain.xml</a>:</p>
<pre class="brush: xml; title: ; notranslate">&lt;cross-domain-policy&gt;
    &lt;allow-access-from domain=&quot;*&quot;/&gt;
    &lt;site-control permitted-cross-domain-policies=&quot;master-only&quot;/&gt;
&lt;/cross-domain-policy&gt;</pre>
<p>Some of those returns &#8220;OAuthAccessTokenException&#8221; thats where new OAuth comes in scene.</p>
<h3>OAuth 2.0</h3>
<p>Second thing noticed was that the company is standardizing the authorization via the <a href="http://github.com/theRazorBlade/draft-ietf-oauth/raw/master/draft-ietf-oauth.txt">OAuth 2.0 standard</a>. The important thing here is, <strong>OAuth is already available for all existing Facebook APIs</strong>, and there are <a href="http://developers.facebook.com/docs/authentication/">multiple methods to get authenticated with OAuth in Facebook</a>. Check out the <a href="http://github.com/facebook/php-sdk/">PHP example code example code for authentication</a> on GitHub. Difference to previous connect is that sessions may last longer than 24 hours.</p>
<p>Lets hope there will be new version of <a href="http://wiki.developers.facebook.com/index.php/Flash/ActionScript">Facebook ActionScript API</a> released soon enough with all these new features&#8230;</p>
<p>Where to go from here:</p>
<ul>
<li><a href="http://developers.facebook.com/docs/authentication/">Facebook Authentication</a></li>
<li><a href="http://developers.facebook.com/docs/reference/api/">Graph API reference</a></li>
<li><a href="http://mashable.com/2010/04/21/open-graph-privacy/">Facebook Open Graph: What it Means for Privacy</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/04/facebook-now-with-oauth-and-open-graph/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Inviting Friends into Facebook Application  (update)</title>
		<link>http://blog.yoz.sk/2010/03/inviting-friends-into-facebook-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=inviting-friends-into-facebook-application</link>
		<comments>http://blog.yoz.sk/2010/03/inviting-friends-into-facebook-application/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:51:26 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[request-form]]></category>
		<category><![CDATA[serverFbml]]></category>
		<category><![CDATA[XFBML]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=1182</guid>
		<description><![CDATA[Those are hard times. Facebook discontinued support for Notifications.send method March 1, 2010. Calling this method returns error code 3 (Unknown method). Instead, developers are directed to use other communication channels. From those some are not yet even a part of facebook-actionscript-api yet (dashboard) other not published from facebook (invites) and those that may work [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/facebookInvites.jpg" alt="" title="facebookInvites" width="200" height="172" class="alignleft size-full wp-image-1183" /></p>
<p>Those are hard times. Facebook discontinued support for <a href="http://wiki.developers.facebook.com/index.php/Notifications.send">Notifications.send</a> method March 1, 2010. Calling this method returns error code 3 (Unknown method). Instead, developers are directed to use other <a href="http://wiki.developers.facebook.com/index.php/Communication_Channels_Best_Practices">communication channels</a>. From those some are not yet even a part of <a href="http://code.google.com/p/facebook-actionscript-api/">facebook-actionscript-api</a> yet (<a href="http://wiki.developers.facebook.com/index.php/Dashboard_API">dashboard</a>) other not published from facebook (<a href="http://wiki.developers.facebook.com/index.php/Roadmap_Invites">invites</a>) and those that may work via api are experimental and may change any day (<a href="http://wiki.developers.facebook.com/index.php/Dashboard.publishActivity">activities</a>).</p>
<p>Excluding <a href="http://wiki.developers.facebook.com/index.php/Roadmap_Stream">streams</a> as communication channel, the only usable way, these days, to acquire some new facebook application users is using <a href="http://wiki.developers.facebook.com/index.php/Fb:request-form">&lt;Fb:request-form&gt;</a> (part of <a href="http://wiki.developers.facebook.com/index.php/Category:FBML_tags">FBML</a>). When your application is IFrame, you may find interesting that you are able to use FBML within your HTML files. In order to make this happen, you have to use <a href="http://wiki.developers.facebook.com/index.php/Fb:serverFbml">&lt;Fb:serverFbml&gt;</a> (renders the FBML on a Facebook server inside an iframe). Now, lets see how to open request form in your Facebook <strong>Iframe</strong> application:</p>
<p><span id="more-1182"></span></p>
<p>First thing you need is <a href="http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel">Cross Domain Communication Channel</a> file . It is simple static file, you should name it xd_receiver.htm</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
   &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head&gt;
    &lt;title&gt;Cross-Domain Receiver Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js?2&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>now your application index.html file with request form:</p>
<pre class="brush: xml; title: ; notranslate">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;&gt;
&lt;head&gt;&lt;/head&gt;
&lt;body&gt;
&lt;script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	window.onload = function()
	{
		FB_RequireFeatures([&quot;XFBML&quot;], function()
		{
			FB.Facebook.init(&quot;*YOUR*API*KEY*HERE*&quot;, &quot;xd_receiver.htm&quot;);
		});
	};
&lt;/script&gt;

&lt;fb:serverFbml style=&quot;width: 750px;&quot;&gt;
	&lt;script type=&quot;text/fbml&quot;&gt;
		&lt;fb:fbml&gt;
			&lt;fb:request-form action=&quot;http://www.google.com&quot; method=&quot;POST&quot; invite=&quot;true&quot; type=&quot;TestApp&quot;
				content=&quot;Join my app &amp;lt;fb:req-choice url=&amp;quot;http://apps.facebook.com/facebookyoztest/&amp;quot; label=&amp;quot;Go Test app&amp;quot; /&amp;gt;&quot;&gt;
				&lt;fb:multi-friend-selector showborder=&quot;false&quot; actiontext=&quot;Invite your friends to use Test app.&quot;&gt;
			&lt;/fb:request-form&gt;
		&lt;/fb:fbml&gt;
	&lt;/script&gt;
&lt;/fb:serverFbml&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Place both files in the same folder (or specify xd_receiver.htm path correctly in FB.Facebook.init() function). Now make sure you setup your application correctly: </p>
<pre class="brush: plain; title: ; notranslate">Canvas Callback URL: http://facebook.yoz.sk/Test/
Connect URL: http://facebook.yoz.sk/Test/
Base Domain: yoz.sk
Canvas URL: http://apps.facebook.com/facebookyoztest/
FBML/iframe: iframe
Application Type: Website</pre>
<p>Now request form should be generated when you visit canvas url.</p>
<p><img src="http://blog.yoz.sk/wp-content/uploads/facebookInvites2.jpg" alt="" title="facebookInvites2" width="400" height="220" class="alignnone size-full wp-image-1197" /></p>
<p>Important:</p>
<ul>
<li><strong>Your application must be iframe type</strong></li>
<li><strong>URLs used in this article are not to be used in your apps</strong></li>
<li><strong>This article was written and is valid on March 9, 2010</strong></li>
</ul>
<h2>Using Invitations in light popup (iframe)</h2>
<p>If you need to show invitation module over your application, you can use this procedure. If you plan to open iframe over flash app make sure your flash is in wmode transparent or opaque so iframe can overlay it&#8230; index.html</p>
<pre class="brush: xml; title: ; notranslate">...
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
	function showInvite(){
		document.getElementById('invite').style.display = 'block';
		document.getElementById('invite').src = &quot;invite.html&quot;;
	}

	function hideInvite(){
		document.getElementById('invite').style.display = 'none';
		document.getElementById('invite').src = &quot;about:blank&quot;;
	}
//--&gt;
&lt;/script&gt;
...
&lt;button onclick=&quot;showInvite()&quot;&gt;show invite&lt;/button&gt;
&lt;button onclick=&quot;hideInvite()&quot;&gt;hide invite&lt;/button&gt;
&lt;iframe id=&quot;invite&quot; width=&quot;584&quot; height=&quot;513&quot; style=&quot;display:none&quot;&gt;&lt;/iframe&gt;</pre>
<p>invite.html</p>
<pre class="brush: xml; title: ; notranslate">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;&gt;
&lt;head&gt;
	&lt;style type='text/css'&gt;
	&lt;!--
		body {margin:0px;overflow:hidden;}
		html, body {width:100%;height:100%;outline:none;}
	--&gt;
	 &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	window.onload = function()
	{
		FB_RequireFeatures([&quot;XFBML&quot;], function()
		{
			FB.Facebook.init(&quot;d5702b09b56c330a5a4c85ab7b2635bd&quot;, &quot;xd_receiver.htm&quot;);
		});
	};
&lt;/script&gt;
&lt;fb:serverFbml style=&quot;width: 584px;&quot;&gt;
	&lt;script type=&quot;text/fbml&quot;&gt;
		&lt;fb:fbml&gt;
			&lt;fb:request-form action=&quot;http://facebook.yoz.sk/testapp/invite_callback.html&quot; method=&quot;POST&quot; invite=&quot;true&quot; type=&quot;TestApp&quot;
				content=&quot;Join my app &amp;lt;fb:req-choice url=&amp;quot;http://www.yoz.sk/phpinfo.php&amp;quot; label=&amp;quot;Go Test app&amp;quot; /&amp;gt;&quot;&gt;
				&lt;fb:multi-friend-selector max=&quot;1&quot; cols=&quot;3&quot; rows=&quot;3&quot; showborder=&quot;true&quot; actiontext=&quot;Invite your friends to use Test app.&quot;/&gt;
			&lt;/fb:request-form&gt;
		&lt;/fb:fbml&gt;
	&lt;/script&gt;
&lt;/fb:serverFbml&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>invite_callback.html</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;sk&quot; lang=&quot;sk&quot; dir=&quot;ltr&quot;&gt;
&lt;head&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
	&lt;!--
		window.parent.hideInvite();
	//--&gt;
	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Continue reading:</p>
<ul>
<li>[deprecated] <a href="http://wiki.developers.facebook.com/index.php/Notifications.send">Notifications.send</a></li>
<li>[deprecated] <a href="http://wiki.developers.facebook.com/index.php/Notifications.sendRequest">Notifications.sendRequest</a></li>
<li>[May 2010] <a href="http://wiki.developers.facebook.com/index.php/Roadmap_Invites">Roadmap Invites</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Dashboard.addNews">Dashboard.addNews</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Dashboard.multiAddNews">Dashboard.multiAddNews</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Multi_friend_selector">Multi friend selector</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Communication_Channels_Best_Practices">Communication Channels Best Practices</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Developer_Roadmap">Developer Roadmap</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/XFBML">XFBML</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Fb:serverFbml">Fb:serverFbml</a></li>
<li><a href="http://wiki.developers.facebook.com/index.php/Fb:request-form">Fb:request-form</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/03/inviting-friends-into-facebook-application/feed/</wfw:commentRss>
		<slash:comments>87</slash:comments>
		</item>
		<item>
		<title>Parsing FQL result</title>
		<link>http://blog.yoz.sk/2010/01/parsing-fql-result/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=parsing-fql-result</link>
		<comments>http://blog.yoz.sk/2010/01/parsing-fql-result/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:43:00 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FacebookCall]]></category>
		<category><![CDATA[FacebookData]]></category>
		<category><![CDATA[FQL]]></category>
		<category><![CDATA[FqlQuery]]></category>
		<category><![CDATA[namespace]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=928</guid>
		<description><![CDATA[Facebook Query Language, or FQL, allows you to use a SQL-style interface to more easily query the same Facebook social data that you can access through other Facebook API methods (assuming your application has access!). Data returned for Facebook ActionScript Api are XML. You can access data via E4X after setting correct namespace. As for [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/fqlExample.png" alt="" title="fqlExample" width="200" height="100" class="alignleft size-full wp-image-937" /></p>
<p><a href="http://wiki.developers.facebook.com/index.php/FQL">Facebook Query Language</a>, or FQL, allows you to use a SQL-style interface to more easily query the same Facebook social data that you can access through other Facebook API methods (assuming your application has access!). Data returned for Facebook ActionScript Api are XML. You can access data via <a href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e72.html">E4X</a> after setting correct namespace. As for now (January 25, 2010), Facebook result defines xmlns=&#8221;http://api.facebook.com/1.0/&#8221; , but it may change in future, so lets make it dynamic&#8230;</p>
<p><span id="more-928"></span></p>
<p style="clear:both;">Use e.g. extended <a href="http://blog.yoz.sk/2009/12/facebooklogger/">FacebookLogger</a> and add these lines</p>
<pre class="brush: as3; title: ; notranslate">public function fql(query:String):void
{
	var call:FacebookCall = facebook.post(new FqlQuery(query));
	call.addEventListener(FacebookEvent.COMPLETE, fqlCallComplete);
}

private function fqlComplete(event:FacebookEvent):void
{
	var data:FacebookData = FacebookData(event.data);
	var xml:XML = XML(data.rawResult);
	var ns:Namespace = xml.namespace();
	default xml namespace = ns;

	var result:Array = [];
	for each(var user:XML in xml.user)
		result.push({uid:user.uid.toString(), name:user.name.toString()});

	default xml namespace = new Namespace(&quot;&quot;);
	dispatchEvent(new ResultEvent(ResultEvent.RESULT, false, true, result));
}</pre>
<p>Notice xml.namespace() line. This method returns Namespace object used in main node (&#8220;http://api.facebook.com/1.0/&#8221;), so we can define it as default xml namespace.  If you do not set empty default namespace after you finish parsing this XML, it may throw some errors later in parsing another XMLs.</p>
<p>this is our fql query:</p>
<pre class="brush: as3; title: ; notranslate">FB.fql(&quot;SELECT uid, name FROM user WHERE uid = XXX&quot;)</pre>
<p>and data.rawResult contains following XML object</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;fql_query_response xmlns=&quot;http://api.facebook.com/1.0/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; list=&quot;true&quot;&gt;
  &lt;user&gt;
    &lt;uid&gt;12345678&lt;/uid&gt;
    &lt;name&gt;Some John Smith&lt;/name&gt;
  &lt;/user&gt;
  &lt;user&gt;
    &lt;uid&gt;12345679&lt;/uid&gt;
    &lt;name&gt;Another John Smith&lt;/name&gt;
  &lt;/user&gt;...</pre>
<p>Notice xmlns attribute in main node.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/01/parsing-fql-result/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Elegant Facebook Login For Desktop Application</title>
		<link>http://blog.yoz.sk/2010/01/elegant-facebook-login-for-desktop-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=elegant-facebook-login-for-desktop-application</link>
		<comments>http://blog.yoz.sk/2010/01/elegant-facebook-login-for-desktop-application/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 11:24:29 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Authorization]]></category>
		<category><![CDATA[DesktopSession]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FacebookLogger]]></category>
		<category><![CDATA[FacebookPopup]]></category>
		<category><![CDATA[FlexIFrame]]></category>
		<category><![CDATA[IFrame]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=915</guid>
		<description><![CDATA[Default facebook login page is usualy opened in new browser window or popup window, so user lose focus from your page. This application opens facebook login page within your flash application, so user will not lose your page. In fact little iframe trick is used. This post connects my 3 previous posts: Flex IFrame – [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/elegantFacebookLogin.jpg" alt="" title="elegantFacebookLogin" width="200" height="124" class="alignleft size-full wp-image-920" /></p>
<p>Default facebook login page is usualy opened in new browser window or popup window, so user lose focus from your page. This application opens facebook login page within your flash application, so user will not lose your page. In fact little iframe trick is used.</p>
<p>This post connects my 3 previous posts: <a href="http://blog.yoz.sk/2009/10/flex-iframe-web-browser-in-flash/">Flex IFrame – Web browser in flash</a>, <a href="http://blog.yoz.sk/2009/12/facebooklogger/">FacebookLogger</a> and <a href="http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/">Facebook Extended Permissions With Authorization by Overriding Class in swc</a> in order to create elegant solution for facebook connect with your desktop application (means outside facebook iframe or fbml). I recomend to read all previous mentioned posts before trying to run this app.</p>
<p><span id="more-915"></span></p>
<p>Final application (view source enabled)</p>
<p><iframe src="http://blog.yoz.sk/examples/elegantFacebookLogin/" style="border:none;" width="100%" height="600"></iframe></p>
<p>FB class. Read more about <a href="http://blog.yoz.sk/2009/12/facebooklogger/">FacebookLogger</a> class here.</p>
<pre class="brush: as3; title: ; notranslate">package
{
    import flash.net.URLRequest;
    import flash.net.URLVariables;

    import mx.core.Application;

    import sk.yoz.events.FacebookLoggerEvent;
    import sk.yoz.net.FacebookLogger;

    public class FB extends FacebookLogger
    {
        private static const SINGLETON_LOCK:Object = {};
        private static const _instence:FB = new FB(SINGLETON_LOCK);

        protected var API_KEY:String = &quot;bc55511efba53af7a3529ea9e7d1989b&quot;;
        protected var APP_SECRET:String = &quot;727616ab7a9acb969e7cec3c7de04d79&quot;;

        private var initCallback:Function;

        public function FB(lock:Object)
        {
            super();

            if(lock != SINGLETON_LOCK)
                throw new Error(&quot;Use FB.instance!&quot;);

            addEventListener(FacebookLoggerEvent.CONNECTED, loggerConnectedHandler)
        }

        public static function get instance():FB
        {
            return _instence;
        }

        public function init2(application:Application):void
        {
            if(public::connected)
                return;
            init(API_KEY, APP_SECRET, application.loaderInfo);
        }

        public function initWithCallback(application:Application, callback:Function):void
        {
            initCallback = callback;
            init2(application);
        }

        private function loggerConnectedHandler(event:FacebookLoggerEvent):void
        {
            if(initCallback != null)
                initCallback();
            initCallback = null;
            // now we are connected, your code may go here
        }

        public function openPopup(login_url:String, auth_token:String):void
        {
            var request:URLRequest = new URLRequest(login_url);
            var variables:URLVariables = new URLVariables();

            variables.req_perms = 'publish_stream';
            variables.api_key = facebook.api_key;
            variables.v = facebook.api_version;
            variables.auth_token = auth_token;
            variables.fbconnect = &quot;true&quot;;
            variables.connect_display = &quot;popup&quot;;

            request.data = variables;

            FacebookPopup.open(request);
        }
    }
}</pre>
<p>DesktopSession class. Read more about <a href="http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/">Overriding Class in swc</a>.</p>
<pre class="brush: as3; title: ; notranslate">... some code ...

protected function onLogin(p_event:FacebookEvent):void {
	p_event.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);

	if (p_event.success) {
		_auth_token = (p_event.data as StringResultData).value;

		FB.instance.openPopup(login_url, _auth_token);

		_waiting_for_login = true;
		dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
	} else {
		onConnectionError(p_event.error);
	}
}

... some code ...</pre>
<p>FacebookPopup class. Read more about <a href="http://blog.yoz.sk/2009/10/flex-iframe-web-browser-in-flash/">Flex IFrame</a>.</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:TitleWindow xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;vertical&quot;
    width=&quot;510&quot; height=&quot;465&quot; xmlns:html=&quot;sk.yoz.html.*&quot; move=&quot;moveHandler()&quot;
    title=&quot;Facebook login&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
    import mx.core.Application;
    import mx.managers.PopUpManager;

    [Bindable]
    protected var url:String;

    [Bindable]
    protected var fb:FB = FB.instance;

    protected function moveHandler():void
    {
        iframe.positionChanged = true;
        iframe.invalidateProperties();
    }

    public function set request(value:URLRequest):void
    {
        var url:String = value.url;
        url += &quot;?&quot;;
        for(var param:String in value.data)
            url += &quot;&amp;&quot; + param + &quot;=&quot; + value.data[param];
        this.url = url;
    }

    public static function open(request:URLRequest):void
    {
        var window:FacebookPopup = new FacebookPopup();
        window.request = request;
        window.visible = true;
        PopUpManager.addPopUp(window, Application(Application.application));
        PopUpManager.centerPopUp(window);
    }

    protected function validateLogin():void
    {
        fb.validate();
        close();
    }

    protected function close():void
    {
        visible = false;
        PopUpManager.removePopUp(this);
    }

    protected function refresh():void
    {
        iframe.url = url;
    }
]]&gt;
&lt;/mx:Script&gt;
&lt;html:IFrame width=&quot;100%&quot; height=&quot;100%&quot; id=&quot;iframe&quot; autoResize=&quot;true&quot;
    url=&quot;{url}&quot; visible=&quot;{visible}&quot;/&gt;
&lt;mx:HBox width=&quot;100%&quot;&gt;
    &lt;mx:Text text=&quot;Clik Ok after you login to Facebook.&quot; /&gt;
    &lt;mx:Spacer width=&quot;100%&quot; /&gt;
    &lt;mx:Label text=&quot;refresh&quot; click=&quot;refresh()&quot; textDecoration=&quot;underline&quot;
        buttonMode=&quot;true&quot;/&gt;
&lt;/mx:HBox&gt;
&lt;mx:HBox width=&quot;100%&quot; horizontalAlign=&quot;center&quot; &gt;
    &lt;mx:Button label=&quot;Ok&quot; click=&quot;validateLogin()&quot;/&gt;
    &lt;mx:Button label=&quot;Cancel&quot; click=&quot;close()&quot;/&gt;
&lt;/mx:HBox&gt;
&lt;/mx:TitleWindow&gt;</pre>
<p>Application (do not forget to add facebook flex .swc, version 3.4 used in example)</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
    import FB;

    [Bindable]
    private var fb:FB = FB.instance;
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Button label=&quot;Facebook connect&quot; click=&quot;fb.init2(this)&quot;/&gt;
&lt;mx:Text text=&quot;{fb.connected ? 'connected' : 'not connected'}&quot; /&gt;
&lt;/mx:Application&gt;</pre>
<p>Application html template. <a href="http://blog.yoz.sk/2009/10/flex-iframe-web-browser-in-flash/">More about flexiframe.js here</a>.</p>
<pre class="brush: xml; title: ; notranslate">... some code ...
&lt;script type=&quot;text/javascript&quot; src=&quot;flexiframe.js&quot;&gt;&lt;/script&gt;
... some code ...</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/01/elegant-facebook-login-for-desktop-application/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Facebook Extended Permissions With Authorization by Overriding Class in swc</title>
		<link>http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=facebook-extended-permissions-with-authorization-by-overriding-class-in-swc</link>
		<comments>http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 12:27:10 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Authorization]]></category>
		<category><![CDATA[DesktopSession]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[swc]]></category>
		<category><![CDATA[URLRequest]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=901</guid>
		<description><![CDATA[It may be not popular, but it is possible to substitute / override whole class from .swc file. Lets say you are using some public api, in our case Facebook actionscript api. I admire work of developer team, but I would like to have some things different. My facebook application requires publish_stream extended permission right [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.yoz.sk/wp-content/uploads/extendedPermissionWithLoginSmall.jpg" alt="" title="extendedPermissionWithLoginSmall" width="200" height="100" class="alignleft size-full wp-image-911" /></p>
<p>It may be not popular, but it is possible to substitute / override whole class from .swc file. Lets say you are using some public api, in our case <a href="http://code.google.com/p/facebook-actionscript-api/">Facebook actionscript api</a>. I admire work of developer team, but I would like to have some things different. My facebook application requires <a href="http://wiki.developers.facebook.com/index.php/Extended_permissions">publish_stream</a> extended permission right after user login (authorize) my application. Even if official facebook api documentation says it is possible to ask for <a href="http://wiki.developers.facebook.com/index.php/Authorization_and_Authentication_for_Desktop_Applications">extended permission with login.php</a> call (req_perms parameter), our facebook actionscript api does not offer setting this parameter.</p>
<p><span id="more-901"></span></p>
<p>After few moments of research it was clear that login.php call makes <a href="http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/actionscript/com/facebook/session/DesktopSession.as">DesktopSession class</a>, method onLogin()&#8230;</p>
<pre class="brush: as3; title: ; notranslate">... some code ...

protected function onLogin(p_event:FacebookEvent):void {
	p_event.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);

	if (p_event.success) {
		_auth_token = (p_event.data as StringResultData).value;

		//now that we have an auth_token we need the user to login with it
		var request:URLRequest = new URLRequest();
		var loginParams:String = '?';

		if (_offline_access) {
				loginParams += 'ext_perm=offline_access&amp;';
		}

		request.url = login_url+loginParams+&quot;api_key=&quot;+api_key+&quot;&amp;v=&quot;+api_version+&quot;&amp;auth_token=&quot;+_auth_token;

		navigateToURL(request, &quot;_blank&quot;);

		_waiting_for_login = true;
		dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
	} else {
		onConnectionError(p_event.error);
	}
}

... some code ...</pre>
<p>Now lets do the dirty work. If it were possible, I would extend DesktopSession class and override just onLogin function, but api creates and uses DesktopSession inside its whole logic, so there is no way to succeed. However, it is possible to override whole class. First, in your flex project (with facebook swc in library path), create directory structure com/facebook/session/ (the same as DesktopSession package defines), than copy <a href="http://code.google.com/p/facebook-actionscript-api/source/browse/trunk/source/actionscript/com/facebook/session/DesktopSession.as">DesktopSession.as</a> file inside. Well, thats it <img src='http://blog.yoz.sk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  &#8230; From now, when you publish your application, compilator uses your DesktopSession instead of the one in .swc.</p>
<p>To make the new class working for my needs, onLogin function needs to be changed into something like this:</p>
<pre class="brush: as3; title: ; notranslate">... some code ...

protected function onLogin(p_event:FacebookEvent):void {
	p_event.target.removeEventListener(FacebookEvent.COMPLETE, onLogin);

	if (p_event.success) {
		_auth_token = (p_event.data as StringResultData).value;

		//now that we have an auth_token we need the user to login with it
		var request:URLRequest = new URLRequest(login_url);
		var variables:URLVariables = new URLVariables();

		variables.req_perms = 'publish_stream';
		variables.api_key = api_key;
		variables.v = api_version;
		variables.auth_token = _auth_token;
		variables.fbconnect = &quot;true&quot;;
		variables.connect_display = &quot;page&quot;;

		request.data = variables;
		navigateToURL(request, &quot;_blank&quot;);

		_waiting_for_login = true;
		dispatchEvent(new FacebookEvent(FacebookEvent.WAITING_FOR_LOGIN));
	} else {
		onConnectionError(p_event.error);
	}
}

... some code ...</pre>
<p>By asking extended permissions with login.php, facebook opens more step authorization dialog where each permissions is separated into own step and user can allow or dont allow each.</p>
<p><img src="http://blog.yoz.sk/wp-content/uploads/extendedPermissionWithLogin.jpg" alt="" title="extendedPermissionWithLogin" width="658" height="713" class="alignnone size-full wp-image-908" /></p>
<p><strong>Important:</strong></p>
<ul>
<li>Even if you send req_perms=publish_stream with login.php, facebook only accepts it when your app is live (not from your desktop testing) &#8230; Functionality already bugged in facebook bugzilla</li>
<li>Even if it is possible to override class this way, consider using it. Next time there may be newer version of .swc with some changes in your overriden class!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2010/01/facebook-extended-permissions-with-authorization-by-overriding-class-in-swc/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>FacebookLogger</title>
		<link>http://blog.yoz.sk/2009/12/facebooklogger/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=facebooklogger</link>
		<comments>http://blog.yoz.sk/2009/12/facebooklogger/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 15:22:34 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[FacebookEvent]]></category>
		<category><![CDATA[FacebookLogger]]></category>
		<category><![CDATA[FacebookLoggerEvent]]></category>
		<category><![CDATA[FacebookSessionUtil]]></category>
		<category><![CDATA[LoaderInfo]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=750</guid>
		<description><![CDATA[In a last couple of weeks I have been working on a lot of facebook applications. It did not took long to realize that there is always the same logic behind logging/connecting to facebook. So I came to FacebookLogger abstraction class that handles these basic steps. It only contains login/connection logic, so its pretty much [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.yoz.sk/wp-content/uploads/facebook-small-logo1.jpg"><img src="http://blog.yoz.sk/wp-content/uploads/facebook-small-logo1.jpg" alt="facebook-small-logo" title="facebook-small-logo" width="200" height="134" class="alignleft size-full wp-image-763" /></a></p>
<p>In a last couple of weeks I have been working on a lot of facebook applications. It did not took long to realize that there is always the same logic behind logging/connecting to facebook. So I came to FacebookLogger abstraction class that handles these basic steps. It only contains login/connection logic, so its pretty much the core that is usable only after extending.</p>
<p><span id="more-750"></span></p>
<p style="clear:both;"><a href="http://classes.yoz.sk/sk/yoz/net/FacebookLogger.as">FacebookLogger</a> class look like this:</p>
<pre class="brush: as3; title: ; notranslate">package sk.yoz.net
{
    import com.facebook.Facebook;
    import com.facebook.events.FacebookEvent;
    import com.facebook.utils.FacebookSessionUtil;

    import flash.display.LoaderInfo;
    import flash.events.EventDispatcher;

    import sk.yoz.events.FacebookLoggerEvent;

    public class FacebookLogger extends EventDispatcher
    {
        protected var facebook:Facebook;
        protected var session:FacebookSessionUtil;

        private var _connected:Boolean = false;

        public function FacebookLogger()
        {
            super();
        }

        [Bindable(event=&quot;FacebookLoggerEventCONNECTED&quot;)]
        public function get connected():Boolean
        {
            return _connected;
        }

        protected function set connected(value:Boolean):void
        {
            _connected = value;
            var type:String = FacebookLoggerEvent.CONNECTED;
            dispatchEvent(new FacebookLoggerEvent(type));
        }

        public function init(apiKey:String, appSecret:String,
            loaderInfo:LoaderInfo):void
        {
            session = new FacebookSessionUtil(apiKey, appSecret, loaderInfo);
            session.addEventListener(FacebookEvent.CONNECT, connectHandler);
            facebook = session.facebook;

            if(loaderInfo.parameters.fb_sig_session_key)
                 session.verifySession();
            else
                login();
        }

        protected function login():void
        {
            session.login();
        }

        public function validate():void
        {
            session.validateLogin();
        }

        protected function connectHandler(event:FacebookEvent):void
        {
            if(!event.success)
                return login();

            protected::connected = true;
        }
    }
}</pre>
<p>&#8230; and you also gonna require <a href="http://classes.yoz.sk/sk/yoz/events/FacebookLoggerEvent.as">FacebookLoggerEvent</a> class &#8230;</p>
<pre class="brush: as3; title: ; notranslate">package sk.yoz.events
{
    import flash.events.Event;

    public class FacebookLoggerEvent extends Event
    {
        public static const CONNECTED:String = &quot;FacebookLoggerEventCONNECTED&quot;;

        public function FacebookLoggerEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
        {
            super(type, bubbles, cancelable);
        }

    }
}</pre>
<p>Now, lets extend the core class. This class should hold all the required logic and communication with facebook, its fine to make it singleton:</p>
<pre class="brush: as3; title: ; notranslate">package
{
    import mx.controls.Alert;
    import mx.core.Application;
    import mx.events.CloseEvent;

    import sk.yoz.events.FacebookLoggerEvent;
    import sk.yoz.net.FacebookLogger;

    public class FB extends FacebookLogger
    {
        public static const NOT_LOGGED:String = &quot;Seems like not logged, click when logged!&quot;;

        private static const SINGLETON_LOCK:Object = {};
        private static const _instence:FB = new FB(SINGLETON_LOCK);

        protected var API_KEY:String = &quot;***&quot;;
        protected var APP_SECRET:String = &quot;***&quot;;

		private var initCallback:Function;

        public function FB(lock:Object)
        {
            super();

            if(lock != SINGLETON_LOCK)
                throw new Error(&quot;Use FB.instance!&quot;);

            addEventListener(FacebookLoggerEvent.CONNECTED, loggerConnectedHandler)
        }

        public static function get instance():FB
        {
            return _instence;
        }

        public function init2(application:Application):void
        {
			if(public::connected)
                return;
            init(API_KEY, APP_SECRET, application.loaderInfo, application.parameters);
        }

        public function initWithCallback(application:Application, callback:Function):void
        {
            initCallback = callback;
            init2(application);
        }

        override protected function login():void
        {
            super.login();
            Alert.show(NOT_LOGGED, null, 4, null, loggedClose);
        }

        protected function loggedClose(event:CloseEvent):void
        {
            validate();
        }

        private function loggerConnectedHandler(event:FacebookLoggerEvent):void
        {
			if(initCallback != null)
                initCallback();
			initCallback = null;
            // now we are connected, your code may go here
        }
    }
}</pre>
<p>Update (Jan 6, 2009): Suggested initWithCallback() function where you can define callback function that is called after successful connect.</p>
<p>&#8230; so we can use in application as simple as possible:</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;
    addedToStage=&quot;addedToStageHandler()&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
    import FB;

    [Bindable]
    private var fb:FB = FB.instance;

    private function addedToStageHandler():void
    {
        fb.init2(this);
    }
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Text text=&quot;{fb.connected ? 'connected' : 'connecting'}&quot; /&gt;
&lt;/mx:Application&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/12/facebooklogger/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

