Skip to content

Instantly share code, notes, and snippets.

View kayalshri's full-sized avatar

Giri Raj kayalshri

View GitHub Profile
@kayalshri
kayalshri / fb-friends-birthday.php
Created April 12, 2014 11:42
Get current month Friends Birthday in Facebook
<?php
if ($user){
$fql = "SELECT uid, name,pic_square, pic_big, birthday_date FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) ";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
@kayalshri
kayalshri / fb-friends-current-location.php
Created April 12, 2014 11:26
Get Current Location of FB Friends
<?php
if ($user){
$fql = "SELECT uid, name, current_location.country FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) ";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
@kayalshri
kayalshri / fb_devices.php
Last active August 29, 2015 13:59
Get Facebook user's devices by using php
<?php
if ($user){
$fql = "SELECT uid, name,devices FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) ";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
@kayalshri
kayalshri / fb_gender.php
Created April 12, 2014 11:07
Get Facebook Friends Gender Percentage
<?php
if ($user){
$fql = "SELECT uid, name, sex FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) ";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
@kayalshri
kayalshri / fb_mutualfriends.php
Created April 12, 2014 10:59
Get Mutual Friends count
<?php
if ($user){
$fql = "SELECT uid, name, online_presence,pic_square, status,mutual_friend_count FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) ";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
#print_r($fqlResult);
@kayalshri
kayalshri / fb_friendsoffriends.php
Created April 12, 2014 10:48
Get Friends of Friends count by using PHP
<?php
if ($user){
$fql = "SELECT uid, name, online_presence,pic_square, status,friend_count FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() ) ";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
@kayalshri
kayalshri / fb_onlinefriends.php
Created April 12, 2014 10:25
Get Online Friends list by using PHP
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://connect.facebook.net/en_US/all.js"></script>
</head>
<body class="skin-black">
@kayalshri
kayalshri / kippt.php
Created April 10, 2014 05:28
Kippt PHP Api integration
<?php
$data_url = "https://kippt.com/api/clips";
$ch = curl_init ($data_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
@kayalshri
kayalshri / googlepagespeed.php
Created April 8, 2014 10:12
Google Page Speed online test api
<?php
$search_url = (@$_GET['url']) ? : "http://ngiriraj.com/pincode/";
$api_key = "xxxxxxxxxxxxxxxxxxx";
//https://console.developers.google.com/
$speed_url = "https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=".$search_url."&key=".$api_key;
print "URL : <BR>".$search_url;
$ch = curl_init ($speed_url);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
@kayalshri
kayalshri / governor.json
Created April 8, 2014 07:26
India Governors list JSON as on 7th Apr 2014
[
{
"header": [
[
"State",
"Governor"
]
],
"data": [