Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

###Invite your readers to leave you a Bitcoin tip on Reddit

Reddit's Bitcoin implementation is ideal for beginners. Here's how to get them to give it a try.


Put this in the structure of your page, right where you want the button to appear:

<a class="tipMeOnReddit" href="">
  <img title="Buy me a beer on Reddit!" src="" />
  Like what you're reading? Buy me a beer on Reddit!

Feel free to change the suggested tip to whatever you like, of course, but be sure to percent-encode it properly.


Put this in the <head> of your page, integrate it with your existing style, or roll your own:

  a.tipMeOnReddit {
    height: 60px;
    font-size: 12px;
    font-family: Verdana, arial, sans-serif;
    padding: 7px 12px 7px 0;
    background: #eee;
    border: 1px solid #666;
    border-radius: 3px;
    box-shadow: 0 0 10px #666;
    text-decoration: none;
    color: #666;
  a.tipMeOnReddit img {
    vertical-align: middle;


The button will work fine without this script, which is what causes the pop-up window to appear, and automatically inserts the page URL into the message, so you have some idea where the tip came from.

Put this at the bottom of your page, as close to the closing </body> tag as possible:

(function(w, d){
  var a = d.getElementsByTagName('A');
  for (var i = 0, n = a.length; i < n; i = i + 1) {
    if (a[i].href && a[i].className && a[i].className === 'tipMeOnReddit') {
      a[i].href = a[i].href.replace(/Tip/, 'Tip for ' + encodeURIComponent(d.URL));
      a[i].onclick = function () {, '_tipme', 'width=550,height=500');
        return false;
}(window, document)); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment