GithubHelp home page GithubHelp logo

doytsujin / hackernews-button Goto Github PK

View Code? Open in Web Editor NEW

This project forked from igrigorik/hackernews-button

0.0 1.0 0.0 175 KB

Embeddable Hacker News button + vote counter for your site

JavaScript 30.24% Go 69.76%

hackernews-button's Introduction

Embeddable Hacker News vote / counter button

HN Button

Async, embeddable submit + vote counter button for Hacker News.

  • If the story has not been posted to HN, "Submit" button is shown, otherwise latest point count is displayed.
  • Auto-detects Google Analytics and registers clicks events (see reports under Traffic Sources > Social > Social Plugins).

Embedding the button

Step 1, place the HN link where you want the button appear on the page:

<!-- Auto-detect URL of current page and title if necessary -->
<a href="http://news.ycombinator.com/submit" class="hn-share-button">Vote on HN</a>

<!-- Override the URL and Title for the button -->
<a href="http://news.ycombinator.com/submit" class="hn-share-button" data-title="Some Title" data-url="http://www.igvita.com/">Vote on HN</a>

Step 2, include the (async) javascript file:

<script src="//hnbutton.appspot.com/static/hn.min.js" async defer></script>

Note: you can safely embed multiple buttons on the same page.

Misc

  • Kudos to @sbashyal and @stbullard for the button styling (hnlike.com)
  • Kudos to Algolia for an awesome HN API
  • (MIT License) - Copyright (c) 2012 Ilya Grigorik

hackernews-button's People

Contributors

igrigorik avatar stereobooster avatar joshblum avatar patrickkettner avatar gjtorikian avatar mathiasbynens avatar

Watchers

 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.