diff --git a/app/Traits/NostrFetcherTrait.php b/app/Traits/NostrFetcherTrait.php index 78769fd..9ba0641 100644 --- a/app/Traits/NostrFetcherTrait.php +++ b/app/Traits/NostrFetcherTrait.php @@ -12,6 +12,37 @@ use swentel\nostr\Subscription\Subscription; trait NostrFetcherTrait { + /** + * Get all NIP-05 handles for a given pubkey from nostr.json + * + * @param string $pubkey The public key in hex format + * @return array Array of handles associated with the pubkey + */ + public function getNip05HandlesForPubkey(string $pubkey): array + { + try { + $response = \Illuminate\Support\Facades\Http::get( + 'https://einundzwanzig.space/.well-known/nostr.json', + ); + $data = $response->json(); + + if (! isset($data['names'])) { + return []; + } + + $handles = []; + foreach ($data['names'] as $handle => $handlePubkey) { + if ($handlePubkey === $pubkey) { + $handles[] = $handle; + } + } + + return $handles; + } catch (\Exception) { + return []; + } + } + public function fetchProfile($npubs) { $hex = collect([]); diff --git a/config/seo.php b/config/seo.php index 5af5b26..aa738f3 100644 --- a/config/seo.php +++ b/config/seo.php @@ -12,7 +12,7 @@ return [ /** * Use this setting to specify the site name that will be used in OpenGraph tags. */ - 'site_name' => 'Einundzwanzig Verein', + 'site_name' => 'EINUNDZWANZIG Verein', /** * Use this setting to specify the path to the sitemap of your website. This exact path will outputted, so @@ -75,7 +75,7 @@ return [ * Use this setting to provide a suffix that will be added after the title on each page. * If you don't want a suffix, you should specify an empty string. */ - 'suffix' => ' - Einundzwanzig Verein', + 'suffix' => ' - EINUNDZWANZIG Verein', /** * Use this setting to provide a custom title for the homepage. We will not use the suffix on the homepage, diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 671326b..050e28d 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -26,10 +26,10 @@ - + Logo -