jkga

kenabella

Posted on May 12, 2020

is-web-monetized

While browsing and reading articles here in DEV, I found this interesting hackathon on my feed and started to read some resources and amazing ideas/projects of other developers around the globe for this API so called web monetization. The docs is straight forward but sadly I'm having a hard time for searching a website that actually use a web monetization. So..... heres what I did!

What I built

💸 I built a very... very... very... simple npm package to let you easily check if a certain website is web monetized

webmonetization.org
https://webmonetization.org/

Submission Category:

Foundational Technology

Demo

You can easily try the tool by installing it globally and running it on your terminal

Installation

  npm install is-web-monetized
Enter fullscreen mode Exit fullscreen mode

Usage (via CLI)

  monetized https://testwebmonetization.com/demo.html
Enter fullscreen mode Exit fullscreen mode

Alt Text

💡 I want to show it in table format. what do you think?

Usage (as dependency)

  const { isWebMonetized } from 'is-web-monetized'
  const url = 'example.com'

  isWebMonetized(url).then(obj => {
    /*
      {
        monetized <boolean>,
        url <url>,
        content <wallet>,
      }
    */
    console.log(obj)
  }).catch(err => console.log(err))
Enter fullscreen mode Exit fullscreen mode

Link to Code

GitHub logo jkga / is-web-monetized

A very simple tool for checking if Web Monetization is enabled

💸 is-web-monetized

A very simple tool for checking if web monetization is enabled on a certain website

JavaScript Style Guide

What is Web Monetization ?

Web Monetization is an API that allows websites to request small payments from users facilitated by the browser and the user's Web Monetization provider.

webmonetization.org

Official Website: https://webmonetization.org/

Installation

  npm install is-web-monetized
Enter fullscreen mode Exit fullscreen mode

Usage

You can check if the website uses the Web Monetization API without going to the website.

💡 Node module MUST be installed globally

  npm install is-web-monetized -g
Enter fullscreen mode Exit fullscreen mode

In your terminal, run monetized [URL]

  monetized example.com 
Enter fullscreen mode Exit fullscreen mode

or using as a dependency

  const { isWebMonetized } from 'is-web-monetized'
  const url = 'example.com'
  isWebMonetized(url).then(obj => {
    /*
      {
        monetized <boolean>,
        url <url>,
        content <wallet>,
      }
    */
    console.log(obj)
  }).catch(err => console.
…
Enter fullscreen mode Exit fullscreen mode

How I built it

If you recall, I said SIMPLE and it is!. This tool is basically just reads the monetization meta in a website

dependencies

💖 💪 🙅 🚩
jkga
kenabella

Posted on May 12, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

is-web-monetized
gftwhackathon is-web-monetized

May 12, 2020