- header("Content-type: text/xml");
-
- $tpl = get_markup_template('xrd_diaspora.tpl');
- $dspr = replace_macros($tpl,array(
- '$baseurl' => App::get_baseurl(),
- '$dspr_guid' => $r['guid'],
- '$dspr_key' => base64_encode(pemtorsa($r['pubkey']))
+ header("Content-type: application/json; charset=utf-8");
+
+ $json = array('subject' => $uri,
+ 'aliases' => array($alias, $profile_url),
+ 'links' => array(array('rel' => NAMESPACE_DFRN, 'href' => $profile_url),
+ array('rel' => NAMESPACE_FEED, 'type' => 'application/atom+xml', 'href' => System::baseUrl().'/dfrn_poll/'.$r['nickname']),
+ array('rel' => 'http://webfinger.net/rel/profile-page', 'type' => 'text/html', 'href' => $profile_url),
+ array('rel' => 'http://microformats.org/profile/hcard', 'type' => 'text/html', 'href' => System::baseUrl().'/hcard/'.$r['nickname']),
+ array('rel' => NAMESPACE_POCO, 'href' => System::baseUrl().'/poco/'.$r['nickname']),
+ array('rel' => 'http://webfinger.net/rel/avatar', 'type' => 'image/jpeg', 'href' => System::baseUrl().'/photo/profile/'.$r['uid'].'.jpg'),
+ array('rel' => 'http://joindiaspora.com/seed_location', 'type' => 'text/html', 'href' => System::baseUrl()),
+ array('rel' => 'salmon', 'href' => System::baseUrl().'/salmon/'.$r['nickname']),
+ array('rel' => 'http://salmon-protocol.org/ns/salmon-replies', 'href' => System::baseUrl().'/salmon/'.$r['nickname']),
+ array('rel' => 'http://salmon-protocol.org/ns/salmon-mention', 'href' => System::baseUrl().'/salmon/'.$r['nickname'].'/mention'),
+ array('rel' => 'http://ostatus.org/schema/1.0/subscribe', 'template' => System::baseUrl().'/follow?url={uri}'),
+ array('rel' => 'magic-public-key', 'href' => 'data:application/magic-public-key,'.$salmon_key)