diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-02-03 07:24:58 +0100 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-02-03 07:24:58 +0100 |
commit | 97bb80c00f4106d63d730f6bcaebf9e4aa247c01 (patch) | |
tree | 43bfb9aa3f85c3b7c2ec19ad72fece95f745ce4d /include/Scrape.php | |
parent | a3fd84661f74b0759f9edad1f068b32820b03c5d (diff) | |
parent | 0a32370e32b068073010d1d6b33241867c3be4d7 (diff) | |
download | volse-hubzilla-97bb80c00f4106d63d730f6bcaebf9e4aa247c01.tar.gz volse-hubzilla-97bb80c00f4106d63d730f6bcaebf9e4aa247c01.tar.bz2 volse-hubzilla-97bb80c00f4106d63d730f6bcaebf9e4aa247c01.zip |
Merge branch 'friendika-master'
Diffstat (limited to 'include/Scrape.php')
-rw-r--r-- | include/Scrape.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/Scrape.php b/include/Scrape.php index bb42c3bdd..ff9899252 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -8,12 +8,18 @@ function scrape_dfrn($url) { $a = get_app(); $ret = array(); + + logger('scrape_dfrn: url=' . $url); + $s = fetch_url($url); if(! $s) return $ret; $headers = $a->get_curl_headers(); + logger('scrape_dfrn: headers=' . $headers, LOGGER_DEBUG); + + $lines = explode("\n",$headers); if(count($lines)) { foreach($lines as $line) { @@ -93,12 +99,17 @@ function scrape_meta($url) { $a = get_app(); $ret = array(); + + logger('scrape_meta: url=' . $url); + $s = fetch_url($url); if(! $s) return $ret; $headers = $a->get_curl_headers(); + logger('scrape_meta: headers=' . $headers, LOGGER_DEBUG); + $lines = explode("\n",$headers); if(count($lines)) { foreach($lines as $line) { @@ -135,6 +146,9 @@ function scrape_vcard($url) { $a = get_app(); $ret = array(); + + logger('scrape_vcard: url=' . $url); + $s = fetch_url($url); if(! $s) @@ -190,15 +204,17 @@ function scrape_feed($url) { return $ret; $headers = $a->get_curl_headers(); + logger('scrape_feed: headers=' . $headers, LOGGER_DEBUG); + $lines = explode("\n",$headers); if(count($lines)) { foreach($lines as $line) { if(stristr($line,'content-type:')) { - if(stristr($line,'application/atom+xml')) { + if(stristr($line,'application/atom+xml') || stristr($s,'<feed')) { $ret['feed_atom'] = $url; return $ret; } - if(stristr($line,'application/rss+xml')) { + if(stristr($line,'application/rss+xml') || stristr($s,'<rss')) { $ret['feed_rss'] = $url; return ret; } |