Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Copyright 2007 Facebook Corp. All Rights Reserved.
- //
- // Application: Do you like Gucci?
- // File: 'index.php'
- // This is a sample skeleton for your application.
- //
- require_once 'facebook.php';
- $appapikey = '43ed45c731b4feb770617c48cd0b38fb';
- $appsecret = '0b1c67cce7a1199a3099ca3038e4d544';
- $facebook = new Facebook($appapikey, $appsecret);
- $user_id = $facebook->require_login();
- // Greet the currently logged-in user!
- echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
- // Print out at most 25 of the logged-in user's friends,
- // using the friends.get API method
- echo "<p>Friends:";
- $friends = $facebook->api_client->friends_get();
- $friends = array_slice($friends, 0, 25);
- foreach ($friends as $friend) {
- echo "<br>$friend";
- }
- echo "</p>";
Add Comment
Please, Sign In to add comment