mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-19 23:07:03 +00:00
added some clarity for the logger
This commit is contained in:
parent
b141c2cff1
commit
9a26a253c9
1 changed files with 11 additions and 21 deletions
|
@ -158,7 +158,6 @@ function fbsync_settings_post(&$a,&$b) {
|
||||||
|
|
||||||
function fbsync_cron($a,$b) {
|
function fbsync_cron($a,$b) {
|
||||||
$last = get_config('fbsync','last_poll');
|
$last = get_config('fbsync','last_poll');
|
||||||
|
|
||||||
$poll_interval = intval(get_config('fbsync','poll_interval'));
|
$poll_interval = intval(get_config('fbsync','poll_interval'));
|
||||||
if(! $poll_interval)
|
if(! $poll_interval)
|
||||||
$poll_interval = FBSYNC_DEFAULT_POLL_INTERVAL;
|
$poll_interval = FBSYNC_DEFAULT_POLL_INTERVAL;
|
||||||
|
@ -166,13 +165,14 @@ function fbsync_cron($a,$b) {
|
||||||
if($last) {
|
if($last) {
|
||||||
$next = $last + ($poll_interval * 60);
|
$next = $last + ($poll_interval * 60);
|
||||||
if($next > time()) {
|
if($next > time()) {
|
||||||
logger('fbsync_cron: poll intervall not reached');
|
logger('fbsync_cron: poll intervall not reached. poll interval: ' . $poll_interval * 60 . '; actual interval: ' . $poll_interval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger('fbsync_cron: cron_start');
|
logger('fbsync_cron: cron_start');
|
||||||
|
|
||||||
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'fbsync' AND `k` = 'sync' AND `v` = '1' ORDER BY RAND()");
|
$r = q("SELECT * FROM `pconfig` WHERE `cat` = 'fbsync' AND `k` = 'sync' AND `v` = '1' ORDER BY RAND()");
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
fbsync_get_self($rr['uid']);
|
fbsync_get_self($rr['uid']);
|
||||||
|
@ -443,16 +443,6 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr
|
||||||
$postarray['allow_cid'] = '<' . $self[0]['id'] . '>';
|
$postarray['allow_cid'] = '<' . $self[0]['id'] . '>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$postarray["location"] = $post->place->name;
|
|
||||||
postarray["coord"] = $post->geo->coordinates[0]." ".$post->geo->coordinates[1];
|
|
||||||
*/
|
|
||||||
|
|
||||||
//$types = array(46, 80, 237, 247, 308);
|
|
||||||
//if (!in_array($post->type, $types))
|
|
||||||
// $postarray["body"] = "Type: ".$post->type."\n".$postarray["body"];
|
|
||||||
//print_r($post);
|
|
||||||
//print_r($postarray);
|
|
||||||
$item = item_store($postarray);
|
$item = item_store($postarray);
|
||||||
logger('fbsync_createpost: User '.$self[0]["nick"].' posted feed item '.$item, LOGGER_DEBUG);
|
logger('fbsync_createpost: User '.$self[0]["nick"].' posted feed item '.$item, LOGGER_DEBUG);
|
||||||
}
|
}
|
||||||
|
@ -1005,7 +995,7 @@ function fbsync_fetchfeed($a, $uid) {
|
||||||
//if ($last_updated == "")
|
//if ($last_updated == "")
|
||||||
$last_updated = 0;
|
$last_updated = 0;
|
||||||
|
|
||||||
logger("fbsync_fetchfeed: fetching content for user ".$self_id);
|
logger("fbsync_fetchfeed: fetching content for user " . $self_id);
|
||||||
|
|
||||||
$fql = array(
|
$fql = array(
|
||||||
"posts" => "SELECT action_links, actor_id, app_data, app_id, attachment, attribution, comment_info, created_time, filter_key, like_info, message, message_tags, parent_post_id, permalink, place, post_id, privacy, share_count, share_info, source_id, subscribed, tagged_ids, type, updated_time, with_tags FROM stream where filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND updated_time > $last_updated ORDER BY updated_time DESC LIMIT 500",
|
"posts" => "SELECT action_links, actor_id, app_data, app_id, attachment, attribution, comment_info, created_time, filter_key, like_info, message, message_tags, parent_post_id, permalink, place, post_id, privacy, share_count, share_info, source_id, subscribed, tagged_ids, type, updated_time, with_tags FROM stream where filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND updated_time > $last_updated ORDER BY updated_time DESC LIMIT 500",
|
||||||
|
@ -1021,7 +1011,7 @@ function fbsync_fetchfeed($a, $uid) {
|
||||||
|
|
||||||
$url = "https://graph.facebook.com/fql?q=".urlencode(json_encode($fql))."&access_token=".$access_token;
|
$url = "https://graph.facebook.com/fql?q=".urlencode(json_encode($fql))."&access_token=".$access_token;
|
||||||
|
|
||||||
$feed = fetch_url($url);
|
$feed = fetch_url($url);
|
||||||
$data = json_decode($feed);
|
$data = json_decode($feed);
|
||||||
|
|
||||||
if (!is_array($data->data)) {
|
if (!is_array($data->data)) {
|
||||||
|
@ -1029,7 +1019,7 @@ function fbsync_fetchfeed($a, $uid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$posts = array();
|
$posts = array();
|
||||||
$comments = array();
|
$comments = array();
|
||||||
$likes = array();
|
$likes = array();
|
||||||
$profiles = array();
|
$profiles = array();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue