示例#1
0
function old_webfinger($webbie)
{
    $host = '';
    if (strstr($webbie, '@')) {
        $host = substr($webbie, strpos($webbie, '@') + 1);
    }
    if (strlen($host)) {
        $tpl = fetch_lrdd_template($host);
        logger('old_webfinger: lrdd template: ' . $tpl, LOGGER_DATA);
        if (strlen($tpl)) {
            $pxrd = str_replace('{uri}', urlencode('acct:' . $webbie), $tpl);
            logger('old_webfinger: pxrd: ' . $pxrd, LOGGER_DATA);
            $links = fetch_xrd_links($pxrd);
            if (!count($links)) {
                // try with double slashes
                $pxrd = str_replace('{uri}', urlencode('acct://' . $webbie), $tpl);
                logger('old_webfinger: pxrd: ' . $pxrd, LOGGER_DATA);
                $links = fetch_xrd_links($pxrd);
            }
            return $links;
        }
    }
    return array();
}
示例#2
0
 function webfinger($s, $debug = false)
 {
     $host = '';
     if (strstr($s, '@')) {
         $host = substr($s, strpos($s, '@') + 1);
     }
     if (strlen($host)) {
         $tpl = fetch_lrdd_template($host);
         logger('webfinger: lrdd template: ' . $tpl);
         if (strlen($tpl)) {
             $pxrd = str_replace('{uri}', urlencode('acct:' . $s), $tpl);
             logger('webfinger: pxrd: ' . $pxrd);
             $links = fetch_xrd_links($pxrd);
             if (!count($links)) {
                 // try with double slashes
                 $pxrd = str_replace('{uri}', urlencode('acct://' . $s), $tpl);
                 logger('webfinger: pxrd: ' . $pxrd);
                 $links = fetch_xrd_links($pxrd);
             }
             return $links;
         }
     }
     return array();
 }