WebfingerUrl.php 399 B

123456789101112131415161718
  1. <?php
  2. namespace App\Util\Webfinger;
  3. use App\Util\Lexer\Nickname;
  4. class WebfingerUrl
  5. {
  6. public static function generateWebfingerUrl($url)
  7. {
  8. $url = Nickname::normalizeProfileUrl($url);
  9. $domain = $url['domain'];
  10. $username = $url['username'];
  11. $path = "https://{$domain}/.well-known/webfinger?resource=acct:{$username}@{$domain}";
  12. return $path;
  13. }
  14. }