aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-05 20:29:26 -0700
committerFriendika <info@friendika.com>2011-07-05 20:29:26 -0700
commit8992c27fa69964bd81ccdc5021e02653e202b27b (patch)
treed145495650ae729abf87a06dc526e5b009694346 /include
parentd7154a4606d8c6f86b2eacd35c16893283b484c4 (diff)
downloadvolse-hubzilla-8992c27fa69964bd81ccdc5021e02653e202b27b.tar.gz
volse-hubzilla-8992c27fa69964bd81ccdc5021e02653e202b27b.tar.bz2
volse-hubzilla-8992c27fa69964bd81ccdc5021e02653e202b27b.zip
better handling of feed photos (e,g, google+)
Diffstat (limited to 'include')
-rw-r--r--include/Scrape.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index 698ec9cf0..c2663a874 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -467,6 +467,14 @@ function probe_url($url) {
if(strpos($vcard['fn'],'@') !== false)
$vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
$email = unxmlify($author->get_email());
+ if(! $vcard['photo']) {
+ $rawtags = $feed->get_feed_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
+ if($rawtags) {
+ $elems = $rawtags[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10];
+ if((x($elems,'link')) && ($elems['link'][0]['attribs']['']['rel'] === 'photo'))
+ $vcard['photo'] = $elems['link'][0]['attribs']['']['href'];
+ }
+ }
}
else {
$item = $feed->get_item(0);
@@ -485,6 +493,14 @@ function probe_url($url) {
if($rawmedia && $rawmedia[0]['attribs']['']['url'])
$vcard['photo'] = unxmlify($rawmedia[0]['attribs']['']['url']);
}
+ if(! $vcard['photo']) {
+ $rawtags = $item->get_feed_tags( SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
+ if($rawtags) {
+ $elems = $rawtags[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10];
+ if((x($elems,'link')) && ($elems['link'][0]['attribs']['']['rel'] === 'photo'))
+ $vcard['photo'] = $elems['link'][0]['attribs']['']['href'];
+ }
+ }
}
}
if((! $vcard['photo']) && strlen($email))