<?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>Facebook Cookbook &#187; extended permission</title>
	<atom:link href="http://fbcookbook.ofhas.in/tag/extended-permission/feed/" rel="self" type="application/rss+xml" />
	<link>http://fbcookbook.ofhas.in</link>
	<description>thousands of app development recipes</description>
	<lastBuildDate>Sun, 21 Mar 2010 10:38:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>facebook reveals status api &#8211; how to use it?</title>
		<link>http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/</link>
		<comments>http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 17:07:35 +0000</pubDate>
		<dc:creator>Hasin Hayder</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[Status]]></category>
		<category><![CDATA[extended permission]]></category>

		<guid isPermaLink="false">http://fbcookbook.ofhas.in/?p=166</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'facebook reveals status api &#8211; how to use it?';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
today facebook revealed their new api to update user&#8217;s status, and i am quite certain that it will play a vital role in the massive &#8220;status&#8221; market that is controlled by twitter. lets see how we can update status of any users of your application using this new API called &#8220;status_set()&#8221;. first thing is to [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'facebook reveals status api &#8211; how to use it?';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p>today facebook revealed their new api to <a href="http://developers.facebook.com/news.php?blog=1&#038;story=193">update user&#8217;s status</a>, and i am quite certain that it will play a vital role in the massive &#8220;status&#8221; market that is controlled by twitter. lets see how we can update status of any users of your application using this new API called &#8220;status_set()&#8221;. first thing is to update your facebook client library <a href="http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz">from this link</a> to make thie api available to your application. and oh, one more thing to note which is very important infact. your users must allow extended permissions for &#8220;status_update&#8221; before you can do it. </p>
<p>here is the code. first it asks for user&#8217;s permission to update his/her status directly from this application. if user grants the permission &#8211; we will display a form to our user. then the rest is just hitting the submitting button with new status</p>
<pre name="code" class="php">

&lt;?php
include_once(&quot;config.php&quot;);
if (!$facebook-&gt;api_client-&gt;users_hasAppPermission(&quot;status_update&quot;)){
echo &#039;&lt;fb:prompt-permission perms=&quot;status_update&quot; next_fbjs=&quot;greet()&quot;&gt;Let us update your status from this application&lt;/fb:prompt-permission&gt;&#039;;
$visibility = &quot;none&quot;;
}
else
$visibility = &quot;block&quot;;

if(isset($_POST[&#039;status&#039;]))
{
    $facebook-&gt;api_client-&gt;users_setStatus($_POST[&#039;status&#039;]);
    echo &quot;&lt;p&gt;Your status has been updated&lt;/p&gt;&quot;;
}
?&gt;
&lt;div id=&quot;statusdiv&quot; style=&quot;display:&lt;?=$visibility;?&gt;;&quot;&gt;
    &lt;form method=&quot;POST&quot;&gt;
        Please update your status:&lt;br/&gt;
        &lt;input type=&quot;text&quot; name=&quot;status&quot; /&gt; &lt;br/&gt;
        &lt;input type=&quot;submit&quot; value=&quot;change status&quot; /&gt;
    &lt;/form&gt;
&lt;/div&gt;

&lt;script&gt;
function greet()
{
    var session = &quot;&lt;?=$facebook-&gt;api_client-&gt;session_key;?&gt;&quot;;
    document.getElementById(&quot;statusdiv&quot;).setStyle(&quot;display&quot;,&quot;block&quot;);
    new Dialog().showMessage(&quot;Info&quot;,&quot;Thank you for granting us this permission! Now you can update your facebook status directly from here.&quot;);
}

&lt;/script&gt;
</pre>
<p>here is the sequence</p>
<p><b>screenshot 1: default view, before granting permission </b><br />
<a href="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-81.png"><img src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-81-300x39.png" alt="picture-81" title="picture-81" width="300" height="39" class="alignnone size-medium wp-image-172" /></a></p>
<p><b>screenshot 2: permission dialogue, asking for the authorization </b><br />
<a href="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-91.png"><img src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-91-300x106.png" alt="picture-91" title="picture-91" width="300" height="106" class="alignnone size-medium wp-image-173" /></a></p>
<p><b>screenshot 3: status update form </b><br />
<a href="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-101.png"><img src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-101-300x100.png" alt="picture-101" title="picture-101" width="300" height="100" class="alignnone size-medium wp-image-174" /></a></p>
<p><b>screenshot 4: confirmation </b><br />
<a href="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-121.png"><img src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-121-299x93.png" alt="picture-121" title="picture-121" width="299" height="93" class="alignnone size-medium wp-image-179" /></a></p>
<p>so this is it! pretty easy, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
	</channel>
</rss>
