if(! function_exists('fetch_lrdd_template')) {
function fetch_lrdd_template($host) {
$tpl = '';
- $url = 'http://' . $host . '/.well-known/host-meta' ;
- $links = fetch_xrd_links($url);
-logger('template: ' . print_r($links,true));
+
+ $url1 = 'https://' . $host . '/.well-known/host-meta' ;
+ $url2 = 'http://' . $host . '/.well-known/host-meta' ;
+ $links = fetch_xrd_links($url1);
+ logger('template (https): ' . print_r($links,true));
+ if(! count($links)) {
+ $links = fetch_xrd_links($url2);
+ logger('template (http): ' . print_r($links,true));
+ }
if(count($links)) {
foreach($links as $link)
if($link['@attributes']['rel'] && $link['@attributes']['rel'] === 'lrdd')
require_once('simplepie/simplepie.inc');
+ if(! $contact)
+ logger('consume feed: anonymous');
$feed = new SimplePie();
$feed->set_raw_data($xml);
if($datedir)
}
$url = $orig_url = notags(trim($_POST['url']));
-
+ $diaspora = false;
$email_conversant = false;
if($url) {
$hcard = unamp($link['@attributes']['href']);
if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')
$profile = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === 'http://joindiaspora.com/seed_location')
+ $diaspora = true;
+
}
}
}
- if(! $profile)
- $profile = $url;
-
+ if(! $profile) {
+ if($diaspora)
+ $profile = $hcard;
+ else
+ $profile = $url;
+ }
if(! x($vcard,'fn'))
if(x($vcard,'nick'))