COVID-19 Tracker web-monetized with News from WHO API ๐ŸŽ‰๐Ÿš€

krishna kakade - Jun 5 '20 - - Dev Community

Note:- If you want to know our hackathon journey how we worked you guys can check it out series of articles for this hackathon & this Article updated with Snaps of app after enabling coil Extension with membership(Monetization Part)๐Ÿ”ฝ๐ŸŒŸ

What We built

For this 2020 Hackathon, we decided to build a project that has a specific feature of web monetization. COVID-19 Tracker & News where we have prepared an exclusive content for all the visitors who have decided to begin monetizing the app.

On the initial load of the app, the bottom photo illustrates what the visitor can only see first. It only displays the global result of the total number of cases for confirmed, recovered, and deaths.

one

Screenshot date and time: 2020-06-04 3:41 PM

Alt Text

We changed some things in app you guys can check that in live view ๐Ÿ‘‰here live and running.

Then, there is a country picker available if the visitor desires to check the case numbers for a specific country.

two

Screenshot date and time: 2020-06-04 3:41 PM

Those are simply teasers of it, but there is hidden content for visitors who chooses to monetize the app. Once they clicked the START MONETIZATION button, they can view all the exclusive contents. As a result, it gives them 100% access to the app's features. However, that private content will entirely disappear when they clicked the STOP MONETIZATION button.

third

However, these buttons will be displayed as disabled when the browser is not supported by a web monetization (Coil)extension.

fourth

View After enabling Coil extensioon with membership

Alt Text

โคดIf this unclear to see then everything is given in detail on Github Repo๐Ÿ˜Š

Submission Category:

  • Foundational Technology

Demo

We deployed the project via Netlify, and you can check it out ๐Ÿ‘‰here live and running.

Link to Code

GitHub logo itshally / wb-covid19

This project is built for a hackathon regarding web monetization api, to showcase an updated counter of COVID-19 cases and to show exclusive news content from WHO.

</๐ŸŒ >Web-Monetization With COVID-19 Tracker & WHO NEWS API </๐Ÿ’ฐ>

Netlify Status

Prequisities for running this project and for seeing exclusive content

  • reactjs intall with nodejs stable Version(v12.14.1)
  • material UI

For seeing exclusive content following are the requirementsโคต

  • coil webmonetization extension (firefox/chrome/safari) with membership then you are able to see news(exclusive content).

Basic view of the app with out coil membershipโคต

basicview

basidc

After enabling coil extension(With membership) view of appโคต

firstview

Live View URLโคต

live Preview

In the project directory, you can run following commandsโคต

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production toโ€ฆ

How we built it

We used Reactjs as our stack for this project, and additional framework and packages like Material UI, axios, and chart.
The project started by implementing the tracker first. We followed along a tutorial for this first phase and I would like to give credits to JavaScript Mastery, which we used it as the 20% content for the website.

The remaining 80% will be the exclusive content where we really worked on that part. We used the All WHO news via RSS to capture all the latest news from the WHO.

To work on our WHO news content, we tried to fetch the RSS to get the translated response into a text, which will then be parsed those strings into a DOM.

componentDidMount(){
   const settings = {
       "url": "https://www.who.int/rss-feeds/news-english.xml",
       "method": "GET",
       "timeout": 0,
   };
   const RSS_URL = settings.url;
   fetch(RSS_URL)
        .then(response => response.text())
        .then(str => new window.DOMParser().parseFromString(str, "text/xml"))
        .then(data => { 
                   // code will be here ...
   });
}



Enter fullscreen mode Exit fullscreen mode

thanks to hally for working on project and dev.to team for hosting hackathons

Authors

  • Hally
  • Krishna

Team Members

GIF

Additional Resources

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player