]> git.mxchange.org Git - friendica-addons.git/commitdiff
facebook: Bug fixed that prevent old posts from being fetched.
authorMichael Vogel <icarus@dabo.de>
Sat, 7 Apr 2012 19:38:45 +0000 (21:38 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 7 Apr 2012 19:38:45 +0000 (21:38 +0200)
facebook/facebook.php

index c09ac2fbe8c73ef8af6ab41a5ea43affbcb335bc..473c5cd06c8d846738b15ac5237c3555bc44e0e5 100755 (executable)
@@ -1208,9 +1208,9 @@ function fb_get_timeline($access_token, &$since) {
                else
                        break;
 
-               $url = $s->paging->next;
+               $url = $j->paging->next;
 
-       } while (($oldestdate > $since) and ($since != 0));
+       } while (($oldestdate > $since) and ($since != 0) and ($url != ''));
 
        if ($newest > $since)
                $since = $newest;
@@ -1241,13 +1241,11 @@ function fb_consume_all($uid) {
        }
        // Get the last date
        $lastdate = get_pconfig($uid,'facebook','lastdate');
-       // echo "Alt: ".$lastdate."\n";
        // fetch all items since the last date
        $j = fb_get_timeline($access_token, &$lastdate);
        if (isset($j->data)) {
                logger('fb_consume_stream: feed: ' . print_r($j,true), LOGGER_DATA);
                fb_consume_stream($uid,$j,false);
-               // echo "Neu: ".$lastdate."\n";
 
                // Write back the last date
                set_pconfig($uid,'facebook','lastdate', $lastdate);
@@ -1432,6 +1430,10 @@ function fb_consume_stream($uid,$j,$wall = false) {
                                }
                        }
 
+                       // Just as a test - to see if these are the missing entries
+                       if(trim($datarray['body']) == '')
+                               $datarray['body'] = $entry->story;
+
                        if(trim($datarray['body']) == '') {
                                logger('facebook: empty body '.$entry->id.' '.print_r($entry, true));
                                continue;