This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var headID = document.getElementsByTagName("head")[0]; | |
var newScript = document.createElement('script'); | |
newScript.type = 'text/javascript'; | |
newScript.src = 'http://www.somedomain.com/somescript.js'; | |
headID.appendChild(newScript); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//require '../src/facebook.php'; //Change this line to point to the correct file path | |
require 'php-sdk/src/facebook.php'; | |
// Create our Application instance (replace this with your appId and secret). | |
$facebook = new Facebook(array( | |
'appId' => '__your__appId__', | |
'secret' => '__your__appSecret__', | |
'cookie' => true, | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class fbrecoread{ | |
<?php | |
/* Private variables and Constants */ | |
const APP_ID = '212318288788000'; | |
const APP_SECRET = '7ae17a52b5f43df287327293644ff364'; | |
private $fb = null; | |
private $session = null; | |
public function __construct($args = array()){ | |
// Create our Application instance (replace this with your appId and secret). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* function to show connectToFB button | |
*/ | |
function showConnectToFB($sessionExpired = false){ | |
$params = array(); | |
/* You will need to request additional permissions if you want to access user's and his/her friends interests */ | |
/* Comment out the below 2 lines if you don't need so */ | |
$params = array("req_perms" => "user_interests,user_likes,user_status,friends_interests,friends_likes,friends_status", | |
"fbconnect" => 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$params = array(); | |
/* | |
* You will need to request additional permissions if you want to access user's and | |
* his/her friends interests. Comment out the below 2 lines if you don't need so | |
*/ | |
$params = array("req_perms" => "user_interests,user_likes,user_status,friends_interests,friends_likes,friends_status", | |
"fbconnect" => 0); | |
$loginUrl = $this->fb->getLoginUrl($params); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
// Get UID of the user | |
$uid = $this->fb->getUser(); | |
// Get basic info about the user | |
$me = $this->fb->api('/me'); | |
// Get the user's facebook stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#the below rules will make ravikiranj.net point to your local web server | |
127.0.0.1 ravikiranj.net | |
127.0.0.1 www.ravikiranj.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function displayHTML(){ | |
try { | |
$uid = $this->fb->getUser(); | |
$me = $this->fb->api('/me'); | |
$musicInterests = $this->fb->api('/me/music'); | |
$musicArr = null; | |
if(!empty($musicInterests['data'])){ | |
foreach($musicInterests['data'] as $item){ | |
$musicArr[] = $item["name"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function to get RSS Feed Items | |
* | |
* @param String $user, Integer $page | |
* @return object response | |
*/ | |
function getRSSFeedItems($limit, $offset) { | |
$baseURL = "http://query.yahooapis.com/v1/public/yql?"; | |
$query = "select title,link,pubDate from rss where url='http://rss.news.yahoo.com/rss/topstories' limit ${limit} offset {$offset}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* Function to build RSS item markup | |
* | |
* @param Array $data, Boolean $xhr | |
* @return String $html | |
*/ | |
function displayHTML($data, $xhr) { | |
if(!$xhr){ | |
$html = <<<HTML |