Merge pull request #161 from annando/master

Some more debug information for twitter-sync and facebook-sync
This commit is contained in:
Tobias Diekershoff 2013-10-29 00:45:11 -07:00
commit 99ed846185
2 changed files with 20 additions and 5 deletions

View file

@ -681,6 +681,11 @@ function fbsync_fetchfeed($a, $uid) {
$data = json_decode($feed); $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(); $posts = array();
$comments = array(); $comments = array();
$likes = array(); $likes = array();

View file

@ -1516,21 +1516,27 @@ function twitter_fetchhometimeline($a, $uid) {
if(count($r)) { if(count($r)) {
$own_id = $r[0]["nick"]; $own_id = $r[0]["nick"];
} else } else {
logger("twitter_fetchhometimeline: Own twitter contact not found for user ".$uid, LOGGER_DEBUG);
return; return;
}
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1", $r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($uid)); intval($uid));
if(count($r)) { if(count($r)) {
$self = $r[0]; $self = $r[0];
} else } else {
logger("twitter_fetchhometimeline: Own contact not found for user ".$uid, LOGGER_DEBUG);
return; return;
}
$u = q("SELECT * FROM user WHERE uid = %d LIMIT 1", $u = q("SELECT * FROM user WHERE uid = %d LIMIT 1",
intval($uid)); intval($uid));
if(!count($u)) if(!count($u)) {
logger("twitter_fetchhometimeline: Own user not found for user ".$uid, LOGGER_DEBUG);
return; return;
}
$parameters = array("exclude_replies" => false, "trim_user" => false, "contributor_details" => true, "include_rts" => true); $parameters = array("exclude_replies" => false, "trim_user" => false, "contributor_details" => true, "include_rts" => true);
//$parameters["count"] = 200; //$parameters["count"] = 200;
@ -1546,8 +1552,10 @@ function twitter_fetchhometimeline($a, $uid) {
$items = $connection->get('statuses/home_timeline', $parameters); $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; return;
}
$posts = array_reverse($items); $posts = array_reverse($items);
@ -1587,8 +1595,10 @@ function twitter_fetchhometimeline($a, $uid) {
$items = $connection->get('statuses/mentions_timeline', $parameters); $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; return;
}
$posts = array_reverse($items); $posts = array_reverse($items);