module

Ktistec::WebFinger::Client

The client.

Constants

ACCOUNT_REGEX = /\ ^https:\/\/(?<host>[^\/]+)(\/.*)?$| ^([^@]+)@(?<host>[^@]+)$| ^(?<host>.+)$ /mx

Class methods

query(account, attempts = 10, deadline : Time::Instant | Nil = nil)

Returns the result of querying for the specified account.

The account should conform to the 'acct' URI Scheme. Liberal validation of this format eases federation with other popular servers.

w = Ktistec::WebFinger.query("acct:toddsundsted@epiktistes.com") # => #<Ktistec::WebFinger::Result:0x108d...>
w.link("http://webfinger.net/rel/profile-page").href # => "https://epiktistes.com/@toddsundsted"

Raises Ktistec::WebFinger::NotFoundError if the account does not exist and Ktistec::WebFinger::RedirectionError if redirection failed. Otherwise, returns Ktistec::WebFinger::Result.

Source