DEV Community

Cover image for is-web-monetized
kenabella
kenabella

Posted on

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

Usage (via CLI)

  monetized https://testwebmonetization.com/demo.html

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))

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/

Specifications: https://webmonetization.org/specification.html

Installation

  npm install is-web-monetized

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

In your terminal, run monetized [URL]

  monetized example.com 

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
โ€ฆ

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

Top comments (9)

Collapse
 
lirantal profile image
Liran Tal

I love CLIs, and this is a cool idea! :)

Collapse
 
jkga profile image
kenabella

thanks @lirantal ! I love CLIs too especially building tools using blessed and blessed-contrib :)

Collapse
 
lirantal profile image
Liran Tal

Ohh now you got me curious. What are you building with blessed?
I used them to build dockly: github.com/lirantal/dockly

Thread Thread
 
jkga profile image
kenabella • Edited

Wow.. looks great! I will try it out :)
I am working on cPanel access log reader. I am not yet done and currently rewriting it to react-blessed implementation github.com/jkga/ghorl.

screenshot

Thread Thread
 
jkga profile image
kenabella

BTW, Thank you for accepting my PR! and here's another one we built using blessed & blessed-contrib

dev.to/jkga/i-sent-a-dashboard-via...

Thread Thread
 
lirantal profile image
Liran Tal

Woah that looks awesome!
Well done

Thread Thread
 
jkga profile image
kenabella

Thank you! :)

Collapse
 
cyberdees profile image
โ˜ž Desigan Chinniah โ˜œ

Hi, @jkga . Do venture across to the Discover section on Coil to discover some sites that are web monetized.

You could also simulate testing via the test-web-monetization site.

Collapse
 
jkga profile image
kenabella

Hello @cyberdees , thank you for the info!