]> git.mxchange.org Git - friendica-addons.git/commitdiff
Some more debug information for twitter-sync and facebook-sync
authorMichael Vogel <icarus@dabo.de>
Tue, 29 Oct 2013 07:09:44 +0000 (08:09 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 29 Oct 2013 07:09:44 +0000 (08:09 +0100)
fbsync/fbsync.php
twitter/twitter.php

index 76e82e70680545d7e38e15c6ff3857ef2a7e9596..6e5ef2c9adffa607bb2dd1a20cf78002283becf1 100644 (file)
@@ -681,6 +681,11 @@ function fbsync_fetchfeed($a, $uid) {
 
        $data = json_decode($feed);
 
+       if (!is_array($data->data)) {
+               logger("fbsync_fetchfeed: Error fetching data for user ".$uid.": ".print_r($data, true));
+               return;
+       }
+
        $posts = array();
        $comments = array();
        $likes = array();
index b7bf77f00db150adbbd34e90b7a56220cbb4996e..e18b74452756702f65af71578cea142d86e6186a 100755 (executable)
@@ -1516,21 +1516,27 @@ function twitter_fetchhometimeline($a, $uid) {
 
        if(count($r)) {
                $own_id = $r[0]["nick"];
-       } else
+       } else {
+               logger("twitter_fetchhometimeline: Own twitter contact not found for user ".$uid, LOGGER_DEBUG);
                return;
+       }
 
        $r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
                intval($uid));
 
        if(count($r)) {
                $self = $r[0];
-       } else
+       } else {
+               logger("twitter_fetchhometimeline: Own contact not found for user ".$uid, LOGGER_DEBUG);
                return;
+       }
 
        $u = q("SELECT * FROM user WHERE uid = %d LIMIT 1",
                intval($uid));
-       if(!count($u))
+       if(!count($u)) {
+               logger("twitter_fetchhometimeline: Own user not found for user ".$uid, LOGGER_DEBUG);
                return;
+       }
 
        $parameters = array("exclude_replies" => false, "trim_user" => false, "contributor_details" => true, "include_rts" => true);
        //$parameters["count"] = 200;
@@ -1546,8 +1552,10 @@ function twitter_fetchhometimeline($a, $uid) {
 
        $items = $connection->get('statuses/home_timeline', $parameters);
 
-       if (!is_array($items))
+       if (!is_array($items)) {
+               logger("twitter_fetchhometimeline: Error fetching home timeline: ".print_r($items, true), LOGGER_DEBUG);
                return;
+       }
 
         $posts = array_reverse($items);
 
@@ -1587,8 +1595,10 @@ function twitter_fetchhometimeline($a, $uid) {
 
        $items = $connection->get('statuses/mentions_timeline', $parameters);
 
-       if (!is_array($items))
+       if (!is_array($items)) {
+               logger("twitter_fetchhometimeline: Error fetching mentions: ".print_r($items, true), LOGGER_DEBUG);
                return;
+       }
 
         $posts = array_reverse($items);