Unleashed.Chat on Nostr: Check out the People Discovery (kind 5301), done on the terminal because clients ...
Check out the People Discovery (kind 5301), done on the terminal because clients don't support it yet.
This DVM searches for pubkeys that another pubkey might want to follow based on its existing follows. If the "source" pubkey is not specified in the job input, the results are returned for the pubkey who signed the job request.
```shell # create kind 5301 job request to get follow recommendations for the dataMachine pubkey, and send to a relay EVENT=$(nak event -k 5301 --tag param="f45f5667ffe7649d7c9f648930c9498cda88974e7ea28929194d0167cdcbc124;p" wss://relay.primal.net)
# extract event ID EVENT_ID=$(jq -r '.id' <<< $EVENT)
# query relay for the response nak req --stream -k 6301 --tag e="$EVENT_ID" wss://relay.primal.net | jq ```
## People Search (kind 5303)
This DVM searches for pubkeys by looking at the `name` and/or `display_name` fields in their profile metadata:
- It checks all profiles in our database, and calculates a similarity score based on the job input. - To avoid returning spammy/scammy profiles, the similarity score is multplied by a ranking score derived from how many reputable profiles follow the matching profile. - Given the input `jack`, there will be lots of perfect matches, but the first result will be Jack Dorsey's pubkey.
{
"id":"50e56b20c27d131d84c5ea2f93fd02562a436c9ba88f1393843f4e3f81eb14b7",
"pubkey":"f45f5667ffe7649d7c9f648930c9498cda88974e7ea28929194d0167cdcbc124",
"created_at":1741348607,
"kind":1,
"tags": [],
"content":"Check out the People Discovery (kind 5301), done on the terminal because clients don't support it yet.\n\nThis DVM searches for pubkeys that another pubkey might want to follow based on its existing follows. If the \"source\" pubkey is not specified in the job input, the results are returned for the pubkey who signed the job request.\n\nExample request:\n\n```json\n{\n \"content\": \"\",\n \"kind\": 5301,\n \"tags\": [[\"p\", \"f45f5667ffe7649d7c9f648930c9498cda88974e7ea28929194d0167cdcbc124\"]]\n}\n```\n\nExample using nak:\n\n```shell\n# create kind 5301 job request to get follow recommendations for the dataMachine pubkey, and send to a relay\nEVENT=$(nak event -k 5301 --tag param=\"f45f5667ffe7649d7c9f648930c9498cda88974e7ea28929194d0167cdcbc124;p\" wss://relay.primal.net)\n\n# extract event ID\nEVENT_ID=$(jq -r '.id' \u003c\u003c\u003c $EVENT)\n\n# query relay for the response\nnak req --stream -k 6301 --tag e=\"$EVENT_ID\" wss://relay.primal.net | jq\n```\n\n## People Search (kind 5303)\n\nThis DVM searches for pubkeys by looking at the `name` and/or `display_name` fields in their profile metadata:\n\n- It checks all profiles in our database, and calculates a similarity score based on the job input.\n- To avoid returning spammy/scammy profiles, the similarity score is multplied by a ranking score derived from how many reputable profiles follow the matching profile.\n- Given the input `jack`, there will be lots of perfect matches, but the first result will be Jack Dorsey's pubkey.\n\n**Example request:**\n\n```json\n{\n \"content\": \"\",\n \"kind\": 5303,\n \"tags\": [\n [\"i\", \"jack\", \"text\"],\n [\"param\", \"max_results\", \"10\"]\n ]\n}\n```\n\n**Example using nak:**\n\n```shell\n# search for the dataMachine profile, add a typo on purpose\nEVENT=$(nak event -k 5303 --tag i=\"datamchaine;text\" wss://relay.primal.net)\n\n# extract event ID\nEVENT_ID=$(jq -r '.id' \u003c\u003c\u003c $EVENT)\n\n# query relay for the response\nnak req --stream -k 6303 --tag e=\"$EVENT_ID\" wss://relay.primal.net | jq\n```\nhttps://m.primal.net/PWtN.mov",
"sig":"c776a712cddb05185edd30a584a14eee9b897b8a2af3a97d7596673ae2306fba7a1b1f3927aea17ae453920815e1545770b290ab089ffdfdd50812825458b8f9"
}