various rss fixes
This commit is contained in:
parent
89d5c42df1
commit
a63de472cf
@ -1499,6 +1499,9 @@ function get_atom_elements($feed,$item,&$author) {
|
|||||||
if($d2 > $d3)
|
if($d2 > $d3)
|
||||||
$res['edited'] = datetime_convert();
|
$res['edited'] = datetime_convert();
|
||||||
|
|
||||||
|
$res['created'] = datetime_convert('UTC','UTC',$res['created']);
|
||||||
|
$res['edited'] = datetime_convert('UTC','UTC',$res['edited']);
|
||||||
|
|
||||||
$rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner');
|
$rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner');
|
||||||
if(! $rawowner)
|
if(! $rawowner)
|
||||||
$rawowner = $item->get_item_tags(NAMESPACE_ZOT,'owner');
|
$rawowner = $item->get_item_tags(NAMESPACE_ZOT,'owner');
|
||||||
@ -1560,7 +1563,7 @@ function get_atom_elements($feed,$item,&$author) {
|
|||||||
$termterm = notags(trim(unxmlify($term)));
|
$termterm = notags(trim(unxmlify($term)));
|
||||||
|
|
||||||
if($termterm) {
|
if($termterm) {
|
||||||
$terms = array(
|
$terms[] = array(
|
||||||
'otype' => TERM_OBJ_POST,
|
'otype' => TERM_OBJ_POST,
|
||||||
'type' => $termtype,
|
'type' => $termtype,
|
||||||
'url' => $termurl,
|
'url' => $termurl,
|
||||||
@ -1568,7 +1571,7 @@ function get_atom_elements($feed,$item,&$author) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$res['term'] = implode(',', $tag_arr);
|
$res['term'] = $terms;
|
||||||
}
|
}
|
||||||
|
|
||||||
$attach = $item->get_enclosures();
|
$attach = $item->get_enclosures();
|
||||||
@ -1663,6 +1666,9 @@ function get_atom_elements($feed,$item,&$author) {
|
|||||||
$res['target'] = $obj;
|
$res['target'] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$res['public_policy'] = 'specific';
|
||||||
|
$res['comment_policy'] = 'none';
|
||||||
|
|
||||||
$arr = array('feed' => $feed, 'item' => $item, 'result' => $res);
|
$arr = array('feed' => $feed, 'item' => $item, 'result' => $res);
|
||||||
|
|
||||||
call_hooks('parse_atom', $arr);
|
call_hooks('parse_atom', $arr);
|
||||||
@ -3207,14 +3213,14 @@ function consume_feed($xml,$importer,&$contact,$pass = 0) {
|
|||||||
$datarray['uid'] = $importer['channel_id'];
|
$datarray['uid'] = $importer['channel_id'];
|
||||||
|
|
||||||
//FIXME
|
//FIXME
|
||||||
$datarray['author_xchan'] = $contact['xchan_hash'];
|
$datarray['owner_xchan'] = $datarray['author_xchan'] = $contact['xchan_hash'];
|
||||||
|
|
||||||
// FIXME pull out the author and owner
|
// FIXME pull out the author and owner
|
||||||
|
|
||||||
|
|
||||||
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
|
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
|
||||||
|
|
||||||
// $xx = item_store($datarray);
|
$xx = item_store($datarray);
|
||||||
$r = $xx['item_id'];
|
$r = $xx['item_id'];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -3267,18 +3273,21 @@ function consume_feed($xml,$importer,&$contact,$pass = 0) {
|
|||||||
$datarray['parent_mid'] = $item_id;
|
$datarray['parent_mid'] = $item_id;
|
||||||
$datarray['uid'] = $importer['channel_id'];
|
$datarray['uid'] = $importer['channel_id'];
|
||||||
//FIXME
|
//FIXME
|
||||||
$datarray['author_xchan'] = $contact['author_xchan'];
|
$datarray['owner_xchan'] = $datarray['author_xchan'] = $contact['xchan_hash'];
|
||||||
|
|
||||||
if(! link_compare($author['owner_link'],$contact['xchan_url'])) {
|
if(! link_compare($author['owner_link'],$contact['xchan_url'])) {
|
||||||
logger('consume_feed: Correcting item owner.', LOGGER_DEBUG);
|
logger('consume_feed: Correcting item owner.', LOGGER_DEBUG);
|
||||||
$author['owner-name'] = $contact['name'];
|
$author['owner_name'] = $contact['name'];
|
||||||
$author['owner-link'] = $contact['url'];
|
$author['owner_link'] = $contact['url'];
|
||||||
$author['owner-avatar'] = $contact['thumb'];
|
$author['owner_avatar'] = $contact['thumb'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger('consume_feed: author ' . print_r($author,true));
|
||||||
|
|
||||||
|
|
||||||
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
|
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
|
||||||
|
|
||||||
// $xx = item_store($datarray);
|
$xx = item_store($datarray);
|
||||||
$r = $xx['item_id'];
|
$r = $xx['item_id'];
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3311,7 +3320,7 @@ function handle_feed($uid,$abook_id,$url) {
|
|||||||
$recurse = 0;
|
$recurse = 0;
|
||||||
$z = z_fetch_url($url,false,$recurse,array('novalidate' => true));
|
$z = z_fetch_url($url,false,$recurse,array('novalidate' => true));
|
||||||
|
|
||||||
logger('handle_feed:' . print_r($z,true));
|
//logger('handle_feed:' . print_r($z,true));
|
||||||
|
|
||||||
if($z['success']) {
|
if($z['success']) {
|
||||||
consume_feed($z['body'],$channel,$x[0],0);
|
consume_feed($z['body'],$channel,$x[0],0);
|
||||||
|
@ -1865,6 +1865,11 @@ function xchan_query(&$items,$abook = true) {
|
|||||||
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
||||||
where xchan_hash in (" . implode(',', $arr) . ") and ( hubloc_flags & " . intval(HUBLOC_FLAGS_PRIMARY) . " )");
|
where xchan_hash in (" . implode(',', $arr) . ") and ( hubloc_flags & " . intval(HUBLOC_FLAGS_PRIMARY) . " )");
|
||||||
}
|
}
|
||||||
|
$xchans = q("select * from xchan where xchan_hash in (" . implode(',',$arr) . ") and xchan_network in ('rss','unknown')");
|
||||||
|
if(! $chans)
|
||||||
|
$chans = $xchans;
|
||||||
|
else
|
||||||
|
$chans = array_merge($xchans,$chans);
|
||||||
}
|
}
|
||||||
if($items && count($items) && $chans && count($chans)) {
|
if($items && count($items) && $chans && count($chans)) {
|
||||||
for($x = 0; $x < count($items); $x ++) {
|
for($x = 0; $x < count($items); $x ++) {
|
||||||
|
Reference in New Issue
Block a user