aboutsummaryrefslogtreecommitdiffstats
path: root/include/Scrape.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-26 14:34:01 -0800
committerfriendica <info@friendica.com>2012-02-26 14:34:01 -0800
commitbdb14d5aadce2f0a2f6dc9c898287ea424642dd8 (patch)
tree0dcb32a0bc309bf1cf7f6d4de9ba3369f0a6ab44 /include/Scrape.php
parent5f7858a688a1b6877246933a6c4c72318c885109 (diff)
downloadvolse-hubzilla-bdb14d5aadce2f0a2f6dc9c898287ea424642dd8.tar.gz
volse-hubzilla-bdb14d5aadce2f0a2f6dc9c898287ea424642dd8.tar.bz2
volse-hubzilla-bdb14d5aadce2f0a2f6dc9c898287ea424642dd8.zip
relative link redirects
Diffstat (limited to 'include/Scrape.php')
-rwxr-xr-xinclude/Scrape.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index 52405ae2d..1835892eb 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');
@@ -556,7 +563,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))