Add example script
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 15 Feb 2009 16:29:47 +0000 (11:29 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 15 Feb 2009 18:01:19 +0000 (13:01 -0500)
Remove some debug statements

framework/Service_Facebook/doc/facebook_example.php [new file with mode: 0644]
framework/Service_Facebook/lib/Horde/Service/Facebook.php

diff --git a/framework/Service_Facebook/doc/facebook_example.php b/framework/Service_Facebook/doc/facebook_example.php
new file mode 100644 (file)
index 0000000..a130f0d
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+define('HORDE_BASE', '/private/var/www/html/horde');
+require_once HORDE_BASE . '/lib/base.php';
+
+$appapikey = 'xxx';    //CHANGE THIS
+$appsecret = 'xxx'; //CHANGE THIS
+
+$facebook = new Horde_Service_Facebook($appapikey, $appsecret, null, false);
+$user_id = $facebook->require_login();
+
+// Use a fql query to get some friend info
+$result = $facebook->fql_query('SELECT name, status FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = ' . $user_id . ')');
+var_dump($result);
+
+// Similar can be done as so using individual api calls...
+//  $friends = $facebook->friends_get();
+//  foreach ($friends as $friend) {
+//    $personArray = $facebook->users_getInfo($friend, 'name');
+//    $person[] = $personArray[0];
+//  }
+//
+//  foreach ($person as $f) {
+//    echo ' ' . $f['name'] . '<br />';
+//  }
+
+
+// Get a list of new notifications:
+var_dump($facebook->notifications_get());
\ No newline at end of file
index 339b905..406ae79 100644 (file)
@@ -1393,7 +1393,7 @@ class Horde_Service_Facebook
             } else {
               $result = json_decode($data, true);
             }
-var_dump($_POST);
+
             if (is_array($result) && isset($result['error_code'])) {
                 throw new Horde_Service_Facebook_Exception(
                     $result['error_msg'], $result['error_code']);