]> git.mxchange.org Git - friendica.git/blobdiff - addon/facebook/facebook.php
suppress some scraping errors when confronted with hybrid/strange
[friendica.git] / addon / facebook / facebook.php
index df2f86d3a96bf145c048aed35baa46352389a11c..acf37fcdbb7d1a87d9769200f5b49b5c1d1a9502 100644 (file)
@@ -1,5 +1,15 @@
 <?php
 
+/**
+ * This module needs a lot of work.
+ *
+ * - setting/storing preferences
+ * - documentation on how to obtain FB API keys for your site 
+ * - ensuring a valid FB login session
+ * - requesting permissions within the FB login session to post on your behalf until permission revoked.
+ *
+ */
+
 
 function facebook_install() {
        register_hook('post_local_end', 'addon/facebook/facebook.php', 'facebook_post_hook');
@@ -26,7 +36,7 @@ function facebook_post_hook(&$a,&$b) {
 
                if($appid && $secret) {
 
-                       $fb_post = get_pconfig($local_user(),'facebook','post');
+                       $fb_post = get_pconfig(local_user(),'facebook','post');
 
                        if($fb_post) {
                                require_once('library/facebook.php');
@@ -38,7 +48,7 @@ function facebook_post_hook(&$a,&$b) {
                                        'cookie' => true
                                ));                     
                                try {
-                                       $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> bbcode($datarray['body']), 'cb' => ''));
+                                       $statusUpdate = $facebook->api('/me/feed', 'post', array('message'=> bbcode($b['body']), 'cb' => ''));
                                } 
                                catch (FacebookApiException $e) {
                                        notice( t('Facebook status update failed.') . EOL);
@@ -46,5 +56,5 @@ function facebook_post_hook(&$a,&$b) {
                        }
                }
        }
+}
 
-}
\ No newline at end of file