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 view 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
Submission Category:
Exciting Experiments
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
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
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
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.
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' // return a promise isWebMonetized(url).then(obj => { /* { monetized <boolean>, url <url>, content <wallet>, } */ console.log(obj) }).catch(
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
the package just only use
- jsdom - for me to easily read the
metas
- isomorphic-fetch
Original Link: https://dev.to/jkga/is-web-monetized-g01
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To