<?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>FQL | Woody Hayday | Blog</title>
	<atom:link href="https://blog.woodylabs.com/tag/fql/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.woodylabs.com</link>
	<description>An exploration of life, technology and writing</description>
	<lastBuildDate>Tue, 13 Jan 2015 15:20:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.woodylabs.com/wp-content/uploads/2015/01/cropped-woody-hayday-yosemite-glacier-point-32x32.jpg</url>
	<title>FQL | Woody Hayday | Blog</title>
	<link>https://blog.woodylabs.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Facebook Graph Api &#8211; Is user a fan of page id &#8211; Using FQL and opengraph to mimic Pages.IsFan</title>
		<link>https://blog.woodylabs.com/2010/09/facebook-graph-api-is-user-a-fan-of-page-id-using-fql-and-opengraph-to-mimic-pages-isfan/</link>
					<comments>https://blog.woodylabs.com/2010/09/facebook-graph-api-is-user-a-fan-of-page-id-using-fql-and-opengraph-to-mimic-pages-isfan/#comments</comments>
		
		<dc:creator><![CDATA[Woody]]></dc:creator>
		<pubDate>Sat, 18 Sep 2010 14:14:02 +0000</pubDate>
				<category><![CDATA[Facebook Graph API]]></category>
		<category><![CDATA[Facebook Pages]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fan gating]]></category>
		<category><![CDATA[fan page]]></category>
		<category><![CDATA[FQL]]></category>
		<guid isPermaLink="false">http://blog.woodylabs.com/?p=403</guid>

					<description><![CDATA[<p>Working with integration of Facebook Connect for authentication is mostly easy at the moment, once you have got your head around FBML etc. However as they are in between switching from the old Restful API and the new graph API there remains the odd little thing that has only a splatter of useful documentation online. [&#8230;]</p>
<p>The post <a href="https://blog.woodylabs.com/2010/09/facebook-graph-api-is-user-a-fan-of-page-id-using-fql-and-opengraph-to-mimic-pages-isfan/">Facebook Graph Api – Is user a fan of page id – Using FQL and opengraph to mimic Pages.IsFan</a> first appeared on <a href="https://blog.woodylabs.com">Woody Hayday | Blog</a>.</p><hr /><a href="https://blog.woodylabs.com">Visit Woody Haydays Blog</a><hr />]]></description>
										<content:encoded><![CDATA[<p>Working with integration of Facebook Connect for authentication is mostly easy at the moment, once you have got your head around FBML etc. However as they are in between switching from the old Restful API and the new graph API there remains the odd little thing that has only a splatter of useful documentation online. The first one of these I have come across is trying to find out if a user (who is logged in to  your site via facebook connect) is a fan of page X.</p>
<p>There is infinite uses for this &#8211; with facebook more and more integrating &#8220;likes&#8221; with their search and other stuff you will need this functionality to drive traffic from facebook. Anyway this used to be the easy case of using https://api.facebook.com/method/pages.isFan?access_token=&#8230; to get a 1 or 0 depending on whether or not the user had &#8220;fanned&#8221; the page/website/whatever.</p>
<p>But then came along the big bad Graph API, which to get this IsFan functionality is a bitch. Getting the &#8220;likes&#8221; directly works for the page owner (which confuses everything) but not for third parties, showing just the popular/main category &#8220;likes&#8221; against them (and you need extended permissions.)<br />
<span id="more-403"></span><br />
Long and short of it there&#8217;s about 5 ways to skin this cat, all of which suck except this one, in my brief, frustrated look into it. In any case this uses FQL and the Graph API call to produce a Boolean indicating whether or not the user has fanned something with id $pageID. It works, in all scenario&#8217;s for me so far.</p>
<blockquote><p>$likeID = $facebook-&gt;api(<br />
array( &#8216;method&#8217; =&gt; &#8216;fql.query&#8217;, &#8216;query&#8217; =&gt;<br />
&#8216;SELECT target_id FROM connection WHERE source_id = $userID AND target_id = $pageID&#8217; )<br />
);</p>
<div>if ( empty($likeID) ) {</div>
<div style="margin-left:20px;">// user has NOT Liked the page/whatever</div>
<div>} else {</div>
<div style="margin-left:20px;">// user HAS Liked the page/whatever</div>
<div>}</div>
</blockquote>
<p>If only facebook would update their documentation to show how easy it is to fql query from the API!</p><p>The post <a href="https://blog.woodylabs.com/2010/09/facebook-graph-api-is-user-a-fan-of-page-id-using-fql-and-opengraph-to-mimic-pages-isfan/">Facebook Graph Api – Is user a fan of page id – Using FQL and opengraph to mimic Pages.IsFan</a> first appeared on <a href="https://blog.woodylabs.com">Woody Hayday | Blog</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.woodylabs.com/2010/09/facebook-graph-api-is-user-a-fan-of-page-id-using-fql-and-opengraph-to-mimic-pages-isfan/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
	</channel>
</rss>
