Link - A Great Article on .htaccess Tricks
| 0 comments | htaccesshttp://corz.org/serv/tricks/htaccess2.php has a great walkthrough of loads of different tips and tricks of using the .htaccess files to make a better web application
http://corz.org/serv/tricks/htaccess2.php has a great walkthrough of loads of different tips and tricks of using the .htaccess files to make a better web application
I have managed to crack the OAuth thing that Facebook has taken up to authenticate web apps calling their new Graph API. I found it quite simple actually.
Before you can make restricted requests, you need to be first issued with an auth_token. To get one you need to send a request to:
https://graph.facebook.com/oauth/authorize?client_id=YOUR_APP_ID&redirect_uri=YOUR_APP_URL&scope=LIST_OF_OBJECTS
LIST_OF_OBJECTS
is where you comma delimit the list of things you will want to access (ie events,photos,email etc). The call returns a code which you then use along with your secret to retrieve the auth_token
http://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&redirect_uri=YOUR_APP_URL&client_secret=YOUR_APP_SECRET&code=THE_CODE
The auth_token is then returned along with an expiry countdown in seconds. This can then be added to any API calls for which you need permission.
I have used just one PHP script to do everything. It just checks if its receiving instructions by the user to make a call as a GET variable else goes along through the authentication procedure until an auth_token is set
Feel free to test it out over at dyl.anjon.es/musicwall
Ingredients:
Crisps (Dorito style) | Plate Full |
Chopped Tomatoes | 1 Tin |
Cheese | Quite a lot grated |
Whole Pepper | 1 sliced (green best) |
Chilli Powder | 5 Pinches |
blog pages - see anything e-mail dylan@dylanjones.info
Last week, Facebook announced some interesting things at their F8 conference. Their BIG plan for the world is to make it a more social and personalized web
. With this in mind they have released a few tools to help the world.
Starting first with their big initiative, the Graph API which is the foundation of the new API.
This is a fantastically easy way to get machine readable (JSON) real-time information from FB. An example:
http://graph.facebook.com/dylanjamesvernonjones
{
"id": "512982904",
"name": "Dylan Jones",
"first_name": "Dylan",
"last_name": "Jones",
"link": "http://www.facebook.com/dylanjamesvernonjones"
}
You get some basic information on me. You can delve deeper into my life by getting my news feed by calling :
http://graph.facebook.com/dylanjamesvernonjones/feed
{
"data": [
{
"id": "512982904_427382302904",
"from": {
"name": "Dylan Jones",
"id": "512982904"
},
"message": "And thats the end of that chapter! (that chapter is maths by the way)",
"icon": "http://photos-f.ak.fbcdn.net/photos-ak-sf2p/v43/53/146139331013/app_2_146139331013_1286.gif",
"attribution": "TweetDeck for iPhone",
"actions": [
{
"name": "Get TweetDeck",
"link": "http://www.tweetdeck.com"
}
],
"created_time": "2010-04-30T10:01:30+0000",
"updated_time": "2010-04-30T10:01:30+0000",
"likes": 2
},
{
"id": "512982904_119487514744084",
"from": {
"name": "Dylan Jones",
"id": "512982904"
},
"message": "Whats that coming over the hill, is it a monster, is it a monster?",
"created_time": "2010-04-29T21:14:12+0000",
"updated_time": "2010-04-29T21:14:12+0000",
"likes": 2 . . . . . . . . . . . .
Using OAuth 2.0 as authentication, you can get more data, if not everything you could possibly want from events, friends, likes etc. More information is available from the documentation on Facebook's Developers site.
I have already put to use this graph API to cache my public facebook messages on my database for inclusion in my live feed on this site located at: me.dylanjones.info For this I just use the json_decode()
function in PHP.
Facebook also announced other things such as social plugins inluding their plan to get a 'Like' button on every page online. Some extra metadata is required for web pages to describe content to facebook, rather than using existing protocols - I did try this on dylanjones.info but it is not valid html so I removed it hastily.
More thoughts and uses for the new Facebook Platform later today.