Facebook app beginner code example

Since it was not so easy for me to get things up and running, I wanted to share it for other developers. This code gets all videos that are uploaded to a page. First you should download the php sdk from github.


<?php
require_once 'facebook.php';

$app_id = "226102437478452"; //Your application ID
$canvas_page = "http://apps.facebook.com/your_canvas_page/"; //Your canvas page
$secret = '1b919de960ba93165650c2385a5b1c7e'; //Your application secret

$auth_url = "http://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&amp;redirect_uri=" . urlencode($canvas_page);
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);

if (empty($data["user_id"])) {
echo("<script> top.location.href='" . $auth_url . "'</script>");
} else {

//this uses the facebook object from facebook.php
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $secret,
));
$user_id = $facebook->getUser();

//page id
$page_id = '134501956646782';
$page_data = $facebook->api('/'.$page_id.'/videos/uploaded');

print_r($page_data);

}

?>
Posted in Facebook | 1 Comment

Albanian Fried Dough with cheese and squashes

Albanian Fried Dough in the pan
Ingredients
1 egg
1 teaspoon of salt
1 teaspoon of sugar
1 teaspoon of baking soda
400 gr flour
500 gr yoghurt
1 or 2 squashes
100 gr or more white cheese

Mix the egg with the yoghurt. Add the flour slowly and continue mixing. Cut the cheese in tiny pieces and put them in the mix. Grind the squashes and add them into the mix.
Continue mixing…
With a spoon, grab some of the mixture and put it in the hot cooking oil (I prefer olive oil).

The result:
Albanian Fried Dough

Posted in Cooking | 2 Comments

My ASUS G73SW Republic Of Gamers Laptop

A week ago I purchased for $1450 the ASUS G73SW 4.4Kg desktop replacement laptop and I love it.

It’s not a laptop you can travel with though.

 

 

Here are the main technical specifications:

  •  Processor: Intel® Core™ i7 2630QM Processor
  • RAM: 8Gb DDR3
  • HD: 1Tb
  • Optical Drive: Blu-Ray DVD Combo
  • Display: 17.3″
  • Graphics: NVIDIA® GeForce® GTX 560M 1.5Gb

 

Posted in Uncategorized | Leave a comment

My very first web site

This is the very first website I’ve developed in Joomla 1.5. I made some fixes because the site got hacked, the english version wasn’t working. I noticed that 2 installations of Joomla were used, one for each language :D . For the existence of multilanguage components? I didn’t know at that time. I’ve deleted the english version, was unuseful, then installed the Joomfish component, added the translations, and that’s it :) .

Posted in Diary | Leave a comment

First diary post

Just added the diary page. I created a page template which gets the posts from the “Diary” category and assigned it to the Diary page.

Posted in Diary | Leave a comment

Developing an Android App

I’ve got my Samsung Galaxy S2 a week ago, now I want to develop an app for it.
I am also reading a book along the way.

Posted in To Do List | Leave a comment

Quit Smoking

I hope this time I’ll quit for real :)

Posted in To Do List | 3 Comments

First post from my Samsung Galaxy S2

Yesterday I  bought the Samsung Galaxy S2. I am amazed by this phone, except the fact that it is too big and won’t fit right in my pocket. I have always the feeling that some pickpocket will steal it :D .I found a worpdress application and am so happy to know that now I can write posts from my phone. This is my first post.

Posted in Mobile | Tagged , | 4 Comments

HTML5 Boilerplate looks interesting

It looks like a perfect startup theme. I will do my next HTML5/CSS site with it.

Posted in Open Source for Web | Leave a comment

I am on google plus

I finally got on google plus. A friend of mine invited me. It looks promising, but I hadn’t time to test it, just did a general test. Also added the google +1 button here.

Posted in Internet | 1 Comment