diff options
author | Michael <icarus@dabo.de> | 2012-02-27 00:03:51 +0100 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-02-27 00:03:51 +0100 |
commit | 18679111f5aed8f1c5e7ccb9857195e52c57765d (patch) | |
tree | bffb4a563ed2fe1ff02a4221e28c608460c866db /include/Scrape.php | |
parent | fe3dfbee5638dd2988bd8b126652b3138572f02c (diff) | |
parent | 6ddd444afde33337235eab3aa9d6d1fe12bcb7a4 (diff) | |
download | volse-hubzilla-18679111f5aed8f1c5e7ccb9857195e52c57765d.tar.gz volse-hubzilla-18679111f5aed8f1c5e7ccb9857195e52c57765d.tar.bz2 volse-hubzilla-18679111f5aed8f1c5e7ccb9857195e52c57765d.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/Scrape.php')
-rwxr-xr-x | include/Scrape.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/Scrape.php b/include/Scrape.php index e98978f38..4c4ad3cdb 100755 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -230,11 +230,16 @@ function scrape_feed($url) { $ret = array(); $s = fetch_url($url); - if(! $s) + $headers = $a->get_curl_headers(); + $code = $a->get_curl_code(); + + logger('scrape_feed: returns: ' . $code . ' headers=' . $headers, LOGGER_DEBUG); + + if(! $s) { + logger('scrape_feed: no data returned for ' . $url); return $ret; + } - $headers = $a->get_curl_headers(); - logger('scrape_feed: headers=' . $headers, LOGGER_DEBUG); $lines = explode("\n",$headers); if(count($lines)) { @@ -258,8 +263,10 @@ function scrape_feed($url) { logger('scrape_feed: parse error: ' . $e); } - if(! $dom) + if(! $dom) { + logger('scrape_feed: failed to parse.'); return $ret; + } $head = $dom->getElementsByTagName('base'); @@ -565,7 +572,7 @@ function probe_url($url, $mode = PROBE_NORMAL) { if($check_feed) { $feedret = scrape_feed(($poll) ? $poll : $url); - logger('probe_url: scrape_feed returns: ' . print_r($feedret,true), LOGGER_DATA); + logger('probe_url: scrape_feed ' . (($poll)? $poll : $url) . ' returns: ' . print_r($feedret,true), LOGGER_DATA); if(count($feedret) && ($feedret['feed_atom'] || $feedret['feed_rss'])) { $poll = ((x($feedret,'feed_atom')) ? unamp($feedret['feed_atom']) : unamp($feedret['feed_rss'])); if(! x($vcard)) |