<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2465922687460317564</id><updated>2024-09-14T12:32:53.476+05:30</updated><category term="PHP"/><category term="Binary"/><category term="Decimal"/><category term="FQL"/><category term="Facebook Graph API"/><category term="PHP Basic Authentication"/><category term="google-code-prettify"/><title type='text'>Welcome to Ramratan Gupta</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2465922687460317564.post-3227267865455991205</id><published>2014-06-06T10:40:00.001+05:30</published><updated>2014-06-06T10:46:26.844+05:30</updated><title type='text'>Facebook permissions comparison from version 1 to version 2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Facebook permissions comparison from version 1 to version 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;356&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;//www.slideshare.net/slideshow/embed_code/35553972&quot; style=&quot;border-width: 1px 1px 0; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;&quot; width=&quot;427&quot;&gt; &lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 5px;&quot;&gt;
&lt;strong&gt; &lt;a href=&quot;https://www.slideshare.net/ramratangupta/facebook-permissions&quot; target=&quot;_blank&quot; title=&quot;Facebook permissions&quot;&gt;Facebook permissions&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/ramratangupta&quot; target=&quot;_blank&quot;&gt;Ramratan Gupta&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/3227267865455991205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ramratangupta.blogspot.com/2014/06/facebook-permissions-comparison-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/3227267865455991205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/3227267865455991205'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/2014/06/facebook-permissions-comparison-from.html' title='Facebook permissions comparison from version 1 to version 2'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465922687460317564.post-7410588819441250562</id><published>2014-02-27T23:38:00.003+05:30</published><updated>2014-02-27T23:44:37.213+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Facebook Graph API"/><category scheme="http://www.blogger.com/atom/ns#" term="FQL"/><title type='text'>In Facebook graph API how to find which commonly liked movies</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This post is not limited to only movies in fact any page type or common interest like -&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #f2f2f2; color: green; font-size: 11px; line-height: 14.079999923706055px; white-space: pre;&quot;&gt;CARS, &lt;/span&gt;&lt;span style=&quot;background-color: #f2f2f2;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;font-size: 11px; line-height: 14.079999923706055px; white-space: pre;&quot;&gt;BOOK, Telecommunication, .&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f2f2f2;&quot;&gt;&lt;span style=&quot;color: green; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11px; line-height: 14.079999923706055px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: green; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 11px; line-height: 14.079999923706055px; white-space: pre;&quot;&gt;Basicaly I am talking about page category.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 11px; line-height: 14.079999923706055px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizrf4R_-ztswGkAWhyl2kZw-OgW8_ZzliMVQB01R5AkoVtTAxtsiKlSa-AuZp8fdTxoXdKeL8OCR50xH-QdWW3lfZhmiuADUdNwfkSrZxg-GizQTAicvr6A17usZNz2-uQ0qZd8YvM_J0n/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizrf4R_-ztswGkAWhyl2kZw-OgW8_ZzliMVQB01R5AkoVtTAxtsiKlSa-AuZp8fdTxoXdKeL8OCR50xH-QdWW3lfZhmiuADUdNwfkSrZxg-GizQTAicvr6A17usZNz2-uQ0qZd8YvM_J0n/s1600/Capture.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: green; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 11px; line-height: 14.079999923706055px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
I am writing this post in answer to a question on&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/22049600/in-facebook-graph-api-how-to-find-which-commonly-liked-movies/22076261#22076261&quot; target=&quot;_blank&quot;&gt;stackoverflow.com&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;First get your total friends by below FQL-&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Before running below FQL you should have &lt;b&gt;user_likes and friends_likes permission&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;SELECT friend_count FROM user WHERE uid = me()
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;it will give total count as below JSON&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{
  &quot;data&quot;: [
    {
      &quot;friend_count&quot;: 511
    }
  ]
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now you have to use limit, for above friends count I have to call 5 times below fql for friends id&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Q1- SELECT uid2 FROM friend WHERE uid1 = me() limit 0,100
Q1- SELECT uid2 FROM friend WHERE uid1 = me() limit 101,200
Q1- SELECT uid2 FROM friend WHERE uid1 = me() limit 201,300
Q1- SELECT uid2 FROM friend WHERE uid1 = me() limit 301,400
Q1- SELECT uid2 FROM friend WHERE uid1 = me() limit 401,511
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now call below FQL - The Answer&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;SELECT page_id,type,profile_section,uid FROM page_fan WHERE uid in
  (SELECT uid2 FROM friend WHERE uid1 = me() limit 0,100)
 and type=&#39;MOVIE&#39; limit 100
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Above FQL will give you the the desired result.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;See the inner FQL where you have to call 5 times the graph call.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;References&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;https://developers.facebook.com/docs/reference/fql/page_fan/&quot; rel=&quot;nofollow&quot; style=&quot;background-color: transparent; border: 0px; color: #4a6b82; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;Page Fan FQL&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a href=&quot;https://developers.facebook.com/docs/reference/fql/friend/&quot; rel=&quot;nofollow&quot; style=&quot;background-color: transparent; border: 0px; color: #4a6b82; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;Friend FQL&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/7410588819441250562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ramratangupta.blogspot.com/2014/02/in-facebook-graph-api-how-to-find-which.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/7410588819441250562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/7410588819441250562'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/2014/02/in-facebook-graph-api-how-to-find-which.html' title='In Facebook graph API how to find which commonly liked movies'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizrf4R_-ztswGkAWhyl2kZw-OgW8_ZzliMVQB01R5AkoVtTAxtsiKlSa-AuZp8fdTxoXdKeL8OCR50xH-QdWW3lfZhmiuADUdNwfkSrZxg-GizQTAicvr6A17usZNz2-uQ0qZd8YvM_J0n/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465922687460317564.post-6527633712489774510</id><published>2014-01-23T18:01:00.000+05:30</published><updated>2014-01-24T11:13:57.580+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="google-code-prettify"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP Basic Authentication"/><title type='text'>PHP Basic Authentication Example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;PHP Basic Authentication Example&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0taihfS7uKXGGK_lJIGAaxD96Zek17mbA9n3d0ZdjjEcMZHuSBJhKCqATWkM8Euy1rgKRIPteeEzJs24WxoWd0E1EKcSiRsxiTK62tDvmg6G2MvKWB4Fbnuuaq-xiBIwc6ovNtqQnJnyv/s1600/Capture.JPG&quot; height=&quot;255&quot; style=&quot;display: inline; float: right;&quot; width=&quot;320&quot; /&gt;By using header() &lt;b&gt;WWW-Authenticate: Basic&lt;/b&gt; in header() function. &lt;/div&gt;
Using this PHP will assign &lt;b&gt;PHP_AUTH_USER, PHP_AUTH_PW and AUTH_TYPE in $_SERVER&lt;/b&gt; array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;?php

$moderator_password = &quot;admin&quot;;
$moderator_admin = &quot;mypassword&quot;;
if (!isset($_SERVER[&#39;PHP_AUTH_USER&#39;])) {
    header(&#39;WWW-Authenticate: Basic realm=&quot;Please Login with moderator login&quot;&#39;);
    header(&#39;HTTP/1.0 401 Unauthorized&#39;);
    exit;
} else {
    //Match the user with predefiend
    if ($moderator_admin == $_SERVER[&#39;PHP_AUTH_USER&#39;] &amp;amp;&amp;amp; $moderator_password == $_SERVER[&#39;PHP_AUTH_PW&#39;]) {
        echo &quot;&amp;lt;p&amp;gt;Hello {$_SERVER[&#39;PHP_AUTH_USER&#39;]}.&amp;lt;/p&amp;gt;&quot;;
    } else {
        //User ID and password are incorrect re-auth
        header(&#39;WWW-Authenticate: Basic realm=&quot;Please Login with moderator login, entered user id password is incorrect&quot;&#39;);
        header(&#39;HTTP/1.0 401 Unauthorized&#39;);
    }
}
?&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.php.net/manual/en/features.http-auth.php&quot; target=&quot;_blank&quot;&gt;http://www.php.net/manual/en/features.http-auth.php&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I have also used on my blog an external JS from&amp;nbsp;&lt;a href=&quot;https://code.google.com/p/google-code-prettify/&quot;&gt;google-code-prettify&lt;/a&gt;&amp;nbsp;(&amp;nbsp;Supports all C-like, Bash-like, and XML-like languages. No need to specify the language) . I found this link from&amp;nbsp;&lt;a href=&quot;http://www.1stwebdesigner.com/css/16-free-javascript-code-syntax-highlighters-for-better-programming/&quot; target=&quot;_blank&quot;&gt;web designer.com&lt;/a&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/6527633712489774510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ramratangupta.blogspot.com/2014/01/php-basic-authentication-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/6527633712489774510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/6527633712489774510'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/2014/01/php-basic-authentication-example.html' title='PHP Basic Authentication Example'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0taihfS7uKXGGK_lJIGAaxD96Zek17mbA9n3d0ZdjjEcMZHuSBJhKCqATWkM8Euy1rgKRIPteeEzJs24WxoWd0E1EKcSiRsxiTK62tDvmg6G2MvKWB4Fbnuuaq-xiBIwc6ovNtqQnJnyv/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465922687460317564.post-1610344598187446672</id><published>2014-01-16T18:55:00.001+05:30</published><updated>2014-01-16T18:56:36.283+05:30</updated><title type='text'>Get Top 5 facebook photos and status message based on time - Facebook Graph API FQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Many time while developing facebook application we need&amp;nbsp;Top 5 facebook photos or top 5 commented photos and based on time so simple solution is&lt;br /&gt;
&lt;br /&gt;
Assumption in below FQL quires created field and time is UNIX time stamp.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Top 5 Liked Picture&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT like_info,pid, &amp;nbsp;src_big FROM photo WHERE &amp;nbsp;aid IN (SELECT aid FROM album WHERE owner=me()) ORDER BY like_info.like_count DESC LIMIT 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Time based fql (1-jan2014 to 16-jan-2014)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT like_info,pid, &amp;nbsp;src_big,created &amp;nbsp;FROM photo WHERE &amp;nbsp;aid IN (SELECT aid FROM album WHERE owner=me()) and created&amp;gt;1388534400 and created&amp;lt;=1389864994&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;ORDER BY like_info.like_count DESC LIMIT 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;To run above fql you need user_photos permission. &lt;a href=&quot;https://developers.facebook.com/docs/reference/fql/photo/&quot; target=&quot;_blank&quot;&gt;FQL Reference for Facebook Photos&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;b&gt;2. Top 5 Commented Picture&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT comment_info,pid, &amp;nbsp;src_big &amp;nbsp;FROM photo WHERE &amp;nbsp;aid &amp;nbsp;IN (SELECT aid FROM album WHERE owner=me()) ORDER BY comment_info.comment_count DESC LIMIT 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Top 5 Liked Status&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT message,like_info FROM status WHERE &amp;nbsp;uid=me() order by like_info.like_count desc LIMIT 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4. Top 5 Commented Status&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT message,comment_info FROM status WHERE &amp;nbsp;uid=me() order by comment_info.comment_count desc LIMIT 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Time based fql (1-jan2014 to 16-jan-2014)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SELECT message,comment_info FROM status WHERE &amp;nbsp;uid=me() and time &amp;gt; 1325376000 and time &amp;lt;=1356912000 order by comment_info.comment_count desc LIMIT 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;To run above fql you need user_status permission. &lt;a href=&quot;https://developers.facebook.com/docs/reference/fql/status/&quot; target=&quot;_blank&quot;&gt;FQL Reference to Status Message&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;
You can run above fql query in &lt;a href=&quot;https://developers.facebook.com/tools/explorer?fql&quot; target=&quot;_blank&quot;&gt;Graph API Explorer&lt;/a&gt;&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;What is the unix time stamp?&lt;/span&gt;&lt;br /&gt;
&lt;blockquote style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, mono;&quot;&gt;The unix time stamp is count of seconds, between January 1st, 1970 at UTC and a particular date&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/1610344598187446672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ramratangupta.blogspot.com/2014/01/facebook-graph-api-fql-get-top-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/1610344598187446672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/1610344598187446672'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/2014/01/facebook-graph-api-fql-get-top-5.html' title='Get Top 5 facebook photos and status message based on time - Facebook Graph API FQL'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465922687460317564.post-4385783524408048437</id><published>2014-01-14T18:49:00.001+05:30</published><updated>2014-01-15T16:34:11.352+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Binary"/><category scheme="http://www.blogger.com/atom/ns#" term="Decimal"/><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>PHP - Binary to Decimal and Decimal to Binary</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Decimal to Binary Number&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
function dec_to_binary($num) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $binary = &quot;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if ($num == 0)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; while ($num &amp;gt; 0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $binary = ($num % 2) . $binary;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $num = floor($num / 2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return $binary;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Binary to Decimal Number&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
function binary_to_dec($binary) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $binarynolength = strlen($binary);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $dec = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; $j = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for ($i = $binarynolength - 1; $i &amp;gt;= 0; $i--) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $curposbit = substr($binary, $i, 1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $dec +=(pow(2, $j) * $curposbit);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $j++;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return $dec;&lt;br /&gt;
}&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/4385783524408048437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ramratangupta.blogspot.com/2014/01/php-binary-to-decimal-and-decimal-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/4385783524408048437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/4385783524408048437'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/2014/01/php-binary-to-decimal-and-decimal-to.html' title='PHP - Binary to Decimal and Decimal to Binary'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2465922687460317564.post-7856978471309997677</id><published>2010-09-16T17:58:00.000+05:30</published><updated>2010-09-16T17:58:08.517+05:30</updated><title type='text'>MY First Blog</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;Dear&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
This is my first blog,&lt;br /&gt;
&lt;br /&gt;
please write your comment to share with me&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Your ideas&lt;/li&gt;
&lt;li&gt;Current Location&lt;/li&gt;
&lt;li&gt;Current Job&lt;/li&gt;
&lt;li&gt;Some thing about me&lt;/li&gt;
&lt;li&gt;Current Profile&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://ramratangupta.blogspot.com/feeds/7856978471309997677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ramratangupta.blogspot.com/2010/09/my-first-blog.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/7856978471309997677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2465922687460317564/posts/default/7856978471309997677'/><link rel='alternate' type='text/html' href='http://ramratangupta.blogspot.com/2010/09/my-first-blog.html' title='MY First Blog'/><author><name>Ramratan Gupta</name><uri>http://www.blogger.com/profile/16166233220165398473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>