aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php37
1 files changed, 19 insertions, 18 deletions
diff --git a/include/network.php b/include/network.php
index 4457f59bc..bcd66cf85 100644
--- a/include/network.php
+++ b/include/network.php
@@ -2,6 +2,7 @@
use Zotlabs\Lib\Zotfinger;
use Zotlabs\Lib\Libzot;
+use Zotlabs\Lib\Queue;
/**
* @file include/network.php
@@ -1333,14 +1334,15 @@ function fetch_xrd_links($url) {
*/
function scrape_feed($url) {
- require_once('library/HTML5/Parser.php');
$ret = array();
$level = 0;
$x = z_fetch_url($url,false,$level,array('novalidate' => true));
- if(! $x['success'])
+ if(! $x['success']) {
+ logger('ERROR fetching URL');
return $ret;
+ }
$headers = $x['header'];
$code = $x['return_code'];
@@ -1374,17 +1376,16 @@ function scrape_feed($url) {
}
}
+ $dom = new DOMDocument();
try {
- $dom = HTML5_Parser::parse($s);
+ $dom->loadHTML( $s);
} catch (DOMException $e) {
- logger('Parse error: ' . $e);
- }
-
- if(! $dom) {
- logger('Failed to parse.');
+ logger('Feed parse error: ' . $e);
+ // logger('Feed parse ERROR: ' . libxml_get_last_error()->message);
return $ret;
}
+
$head = $dom->getElementsByTagName('base');
if($head) {
foreach($head as $head0) {
@@ -1437,10 +1438,10 @@ function do_delivery($deliveries, $force = false) {
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
- if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300)) && (! $force)) {
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',3000)) && (! $force)) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
foreach($deliveries as $d) {
- update_queue_item($d);
+ Queue::update($d);
}
return;
}
@@ -1846,15 +1847,15 @@ function probe_api_path($host) {
function scrape_vcard($url) {
- require_once('library/HTML5/Parser.php');
-
$ret = array();
logger('url=' . $url);
$x = z_fetch_url($url);
- if(! $x['success'])
+ if(! $x['success']) {
+ logger('ERROR fetching URL');
return $ret;
+ }
$s = $x['body'];
@@ -1871,14 +1872,14 @@ function scrape_vcard($url) {
}
}
+ $dom = new DOMDocument();
try {
- $dom = HTML5_Parser::parse($s);
+ $dom->loadHTML( $s);
} catch (DOMException $e) {
- logger('Parse error: ' . $e);
- }
-
- if(! $dom)
+ logger('hCard parse error: ' . $e);
+ // logger('hCard fetch ERROR: ' . libxml_get_last_error()->message);
return $ret;
+ }
// Pull out hCard profile elements