Git Product home page Git Product logo

xmr's Introduction

CoinHive Miner Embed Template

This template allows you to easily embed the CoinHive Miner into your own site to earn money without ads by letting your site visitors optionally mine Monero (a cryptocurrency similar to Bitcoin, Ether, etc.) using their CPU power by leaving the page open.

Demo on my website

Quick Start

  1. Signup for CoinHive
  2. Once logged in, go to your Sites & API Keys Settings and then copy the text next to Site Key (public)
  3. Fork this GitHub Repo
  4. Replace UB0lonLFJXV0T5HYTiTcqgEJhcI9cxKW in index.html with the key you copied above
  5. Embed into your site with the following code (replace USERNAME with your GitHub username so for example, for me you would put bgiesing)
<div class="codegena_iframe"><iframe src="https://USERNAME.github.io/CoinHiveMiner/index.html" height="255" width="442"  style="border:0px;float:middle;"></iframe></div><style>.codegena_iframe{position:relative;padding-bottom:32%;height:0;overflow: hidden;max-width:100%;}.codegena_iframe iframe{position:absolute;top:0;left:0;width:100%;height:100%;}</style>

Once you have it set up, you can optionally swap out the text, color scheme, and/or CoinHive logo with your own branding to make it fit better into your page.

Alternatives

The above 5 steps will get you up quickly but you don't have to do it exactly as mentioned above. I made this based around GitHub Pages to make it simple and work on sites that don't allow HTML page uploads with their own styling (common in CMSes like WordPress, Blogger, etc.) but there's other hosting options and ways to embed it if you prefer.

  • Host it on your own server. If your host allows you to directly upload HTML files, you can just upload the index.html file to your site, rename it to something else (to not conflict with your website) and replace the full URL in the embed code above to the page.
  • You also don't have to even embed it, just link the GitHub Pages URL directly.
  • GitLab is another Git service that has page hosting

Disclaimer/Credits

I'm not associated with CoinHive and this code is based heavily on their original code on their homepage. All I did was modualize it into simple embed and optimized the code to remove CSS/JS/IMGs that are no longer used after converting it.

xmr's People

Contributors

bgiesing avatar gradosrawk avatar

Stargazers

 avatar

Watchers

James Cloos 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.