]> git.mxchange.org Git - friendica-addons.git/commitdiff
fbpost: Now groups and pages can be mirrored as well
authorMichael Vogel <icarus@dabo.de>
Tue, 1 Jan 2013 22:38:15 +0000 (23:38 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 1 Jan 2013 22:38:15 +0000 (23:38 +0100)
fbpost/fbpost.php

index cdb1f05ac28d620618f4a222083c1bb7733aabf0..9c2ee0cbdb46d9ce8e3737ccbe25d364bfccf043 100644 (file)
@@ -1008,10 +1008,13 @@ function fbpost_cron($a,$b) {
 
 function fbpost_fetchwall($a, $uid) {
        $access_token = get_pconfig($uid,'facebook','access_token');
+       $post_to_page = get_pconfig($uid,'facebook','post_to_page');
        $lastcreated = get_pconfig($uid,'facebook','last_created');
-       $lastcreated = "";
 
-       $url = 'https://graph.facebook.com/me/feed?access_token='.$access_token;
+       if ((int)$post_to_page == 0)
+               $post_to_page = "me";
+
+       $url = "https://graph.facebook.com/".$post_to_page."/feed?access_token=".$access_token;
 
        if ($lastcreated != "")
                $url .= "&since=".urlencode($lastcreated);