hackernews-button

Embeddable Hacker News button + vote counter for your site

  • 所有者: igrigorik/hackernews-button
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

主要指标

概览
名称与所有者igrigorik/hackernews-button
主编程语言Go
编程语言JavaScript (语言数: 2)
平台
许可证
所有者活动
创建于2012-04-15 16:18:24
推送于2019-01-10 04:05:59
最后一次提交2014-08-31 19:24:24
发布数0
用户参与
星数413
关注者数12
派生数25
提交数42
已启用问题?
问题数9
打开的问题数1
拉请求数4
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?