how to get facebook authorization token for http posts

4
Jan
0

make a page and paste the code below in, you need to provide an app id. After that you have a variable containing your facebook token for doing http posts to the graph. yeeaaa!!

<html>

<head>

<title>Client Flow Example</title>

</head>

<body>

<script>

/*

function displayUser(user) {

var userName = document.getElementById(’userName’);

var greetingText = document.createTextNode(’Greetings, ‘+ user.name + ‘.’);

userName.appendChild(greetingText);

}

*/

function get_token(){

alert(”token = “+window.facebook_token);

}

// var appID = “YOUR_APP_ID”;

var appID = “296325090405460″;

if (window.location.hash.length == 0) {

var path = ‘https://www.facebook.com/dialog/oauth?’;

var queryParams = ['client_id=' + appID,'redirect_uri=' + window.location,'response_type=token'];

var query = queryParams.join(’&’);

var url = path + query;

myWindow=window.open(url);

}

else {

var accessToken = window.location.hash.substring(1);

var path = “https://graph.facebook.com/me?”;

var queryParams = [accessToken, 'callback=displayUser'];

var query = queryParams.join(’&’);

var url = path + query;

// use jsonp to call the graph

var script = document.createElement(’script’);

script.src = url;

document.body.appendChild(script);

//var token = document.createElement(’token’);

//window.opener.appendChild(token);

//window.opener.document.write(”<span id=’token’ >”+accessToken+”</span>”);

//window.opener.document.write(”<span id=’token’ style=’display:none’>”+accessToken+”</span>”);

window.opener.facebook_token=accessToken;

window.close();

}

</script>

<p id=”userName”></p>

<a onClick=”get_token()”>show me the token</a>

</body>

</html>

Filed under: Uncategorized

fixed footers in jquery mobile

8
Nov
0

how to get a fixed footer in jquery mobile with ajax page transistion still working. Hope this helps someone it took me a while. view source to see whats in the script tags below

working example: http://publichotels.ideawork.com/chicago/mobile/

what you need to do

1) auto hide the url bar ( for iphones )


2) add jquery mobile scroll view, you can get new copies from github but these have my option settings

"



"

3)disable scrolling on the footer

  //remove touchmove so you cant scroll the footer
  $(document).bind("touchmove",function(event){
	event.preventDefault();
   });
   document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
 

4) add data-scrole=”true” to the div you want to scroll ie the conent body

Filed under: Uncategorized

to do

19
Aug
0

build blog that explains how to build a blog that will build more blogs.

Filed under: Uncategorized

add php code coloring to different file extensions cs5

1
Aug
0

in cs5 the code coloring declarations are in your user data not in dreaweavers program directory add the extensions here:

“C:\Users\YOUR USER NAME\AppData\Roaming\Adobe\Dreamweaver CS5.5\en_US\Configuration\DocumentTypes\MMDocumentTypes.xml”

Filed under: Uncategorized

retarting apache in debian 9

17
May
2

go to /etc/init.d
type sudo ./apache2 restart

Tagged as:

php insert string into a string

21
Apr
1

$string = “picture.jpg”;
$new = “_new”;
$pos = “.jpg”;
echo str_replace($pos, $new.$pos ,$string);

Tagged as:

mysql inner join 4 tables example

18
Apr
1

from sites inner join sensors inner join fields
on sites.site_key = sensors.site_key and sensors.sensor_key = fields.sensor_key
inner join user_sites_field_preferences
on fields.field_key = user_sites_field_preferences.field_key
where user_sites_field_preferences.user_site_field_preference_key = 54 = $key “;

Filed under: Uncategorized

How to do an .rpm install

29
Mar
0

rpm -Uvh filename.rpm

command to get your version of linuz

29
Mar
0

$ uname -mrsn

php get file names in a directory

25
Dec
1

This function simply returns an array containing a list of a directory’s contents.

function getDirectoryList ($directory)
{

// create an array to hold directory list
$results = array();

// create a handler for the directory
$handler = opendir($directory);

// open directory and walk through the filenames
while ($file = readdir($handler)) {

// if file isn't this directory or its parent, add it to the results
if ($file != "." && $file != "..") {
$results[] = $file;
}

}

// tidy up: close the handler
closedir($handler);

// done!
return $results;

}

?>

Filed under: Uncategorized