Giter VIP home page Giter VIP logo

nostr-url-shortener's Introduction

w3.do - URL Shortener on NOSTR Network

A free URL shortener service enabled by the NOSTR protocol, that is fast and fuss-free, stripped of all bells and whistles, no gimmicks—it just works!

Visit w3.do, the URL shortener service enabled by the NOSTR protocol.

Kind 1994

const id = nanoid(8);

const event = new NDKEvent();
event.kind = 1994;
event.tags = [
  ["d", id],
  ["r", '<user input>'],
];

Why 1994?

Because URLs (Uniform Resource Locators) were defined in 1994 by Tim Berners-Lee, the inventor of the World Wide Web. [source: Wikipedia]

API

Create a short URL

You can use this API to create a short URL.

GET https://w3.do/get?url=<url>

For example: https://w3.do/get?url=https://github.com/jinglescode/nostr-url-shortener

This will return a JSON response, for example:

{
  "id":"xNQ8b0HZ",
  "url":"w3.do/xNQ8b0HZ",
  "eid":"a62729f9e11506183672f1e37bc4617af94636169b3c5b25db6c16b0cd05fbf1"
}

Check if a short URL exists

GET https://w3.do/check?url=<url>

Example: https://w3.do/check?url=https://github.com/jinglescode/nostr-url-shortener

Check using ID

GET https://w3.do/check?id=<id>

Example: https://w3.do/check?id=MSbbaU8l

Get all links by pubkey

GET https://w3.do/check?pubkey=<pubkey hex>

Example: https://w3.do/check?pubkey=efc37e97fa4fad679e464b7a6184009b7cc7605aceb0c5f56b464d2b986a60f0

Support this project

  • Fund Raiser - Join the global community to support project on Geyser Fund, a crowdfunding platform. The funds will be used to pay for contributors and bounties.

  • Contribute - Contribute directly by submitting a pull request.

  • Try it and share it - Try the URL shortener service and share it.

Potential features

  • support to handle nostr slugs, like nevent, npub, note, nprofile
  • something about njump? https://github.com/fiatjaf/njump
  • use bech32 too, use nip89 to store user preferred client

Contributors

nostr-url-shortener's People

Contributors

jinglescode avatar fishcakeday avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.