WIP Render nostr profile and relay status with Ruby
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
module NostrManager
|
||||
class DiscoverUserProfile < NostrManagerService
|
||||
MAX_EVENTS = 3
|
||||
MAX_EVENTS = 2
|
||||
|
||||
def initialize(pubkey:)
|
||||
def initialize(pubkey:, relays: nil)
|
||||
@pubkey = pubkey
|
||||
@relays = Setting.nostr_discovery_relays
|
||||
@relays = relays.present? ? relays : Setting.nostr_discovery_relays
|
||||
end
|
||||
|
||||
def call
|
||||
@@ -30,9 +30,7 @@ module NostrManager
|
||||
end
|
||||
end
|
||||
|
||||
latest_event = profile_events.min_by { |e| e["created_at"] }
|
||||
|
||||
puts latest_event.inspect
|
||||
profile_events.min_by { |e| e["created_at"] }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module NostrManager
|
||||
class DiscoverUserRelays < NostrManagerService
|
||||
MAX_EVENTS = 3
|
||||
MAX_EVENTS = 2
|
||||
|
||||
def initialize(pubkey:)
|
||||
@pubkey = pubkey
|
||||
@@ -31,11 +31,7 @@ module NostrManager
|
||||
end
|
||||
end
|
||||
|
||||
latest_event = nip65_events.min_by { |e| e["created_at"] }
|
||||
tags = latest_event["tags"]
|
||||
|
||||
# puts latest_event.inspect
|
||||
puts tags.select{ |t| t[0] == "r" }.inspect
|
||||
nip65_events.min_by { |e| e["created_at"] }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user