0.0.19 • Published 5 months ago

getprofile v0.0.19

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago


GitHub license npm npm Github Stars

Nostr Event Fetcher

This is a simple utility that subscribes to a Nostr relay, fetches events of specified kinds, and stores the parsed results in a JSON file.

Features

  • Fetches and parses events from Nostr network
  • Writes the fetched data into a JSON file
  • Allows specifying event kinds to filter the events
  • Supports caching of fetched data for later use

Usage

  1. Clone the repository:
git clone https://github.com/nostrapps/getprofile.git
cd yourrepository
  1. Install the dependencies:
npm install
  1. Run the script:
node index.js

By default, the script uses 'de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645' as the user. If you want to use a different user, pass the user's public key as a command line argument:

node index.js <pubkey> <relay>

This will create a new directory under the ./cache directory named after the user's public key, and a JSON file named index.json in this directory. The JSON file will contain the parsed data from the fetched events.

Data Structure

The JSON file will have the following structure:

{
  '@context': 'https://w3id.org/nostr/context',
  '@type': 'Profile',
  '@id': 'nostr:pubkey:de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645',
  mainEntityOfPage: '',
  name: 'melvincarvalho',
  image: 'https://void.cat/d/Eon6A2onyvTWGSseNkwQ4v.webp',
  description: 'Mathematician and Web Developer',
  picture: 'https://void.cat/d/Eon6A2onyvTWGSseNkwQ4v.webp',
  website: 'https://melvincarvalho.com/',
  nip05: '_@melvincarvalho.com',
  about: 'Mathematician and Web Developer',
  banner: 'https://void.cat/d/KhHoehWtdyXFjmDh1NxKWZ',
  display_name: 'Melvin Carvalho',
  lud16: 'melvincarvalho@ln.tips',
  lud06: 'LNURL1DP68GURN8GHJ7MR9VAJKUEPWD3HXY6T5WVHXXMMD9AKXUATJD3CZ7ET9XFVR25S5W7VAN',
  displayName: 'Melvin Carvalho',
  pubkey: 'de7ecd1e2976a6adb2ffa5f4db81a7d812c8bb6698aa00dcf1e76adb55efd645',
  npub: 'npub1melv683fw6n2mvhl5h6dhqd8mqfv3wmxnz4qph83ua4dk4006ezsrt5c24',
  created_at: 1699085316
}

Dependencies

This utility uses the following npm packages:

  • nostr: This is the main package that is used to communicate with the Nostr network.
  • fs: This package is used to write the parsed data into a JSON file.
  • path: This package is used to handle file and directory paths.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Contact

If you have any questions or issues, please open an issue on this repository.

0.0.15

5 months ago

0.0.16

5 months ago

0.0.17

5 months ago

0.0.18

5 months ago

0.0.19

5 months ago

0.0.14

5 months ago

0.0.13

12 months ago

0.0.12

12 months ago

0.0.11

12 months ago

0.0.10

12 months ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago