nowfound

Life & fun · June 25, 2012

How HN's upvote link works

Each link has an anchor tag like this: <a href="vote?for=4156127&dir=up&by=asto&auth=12345&whence=%6e%65%77%73" onclick="return vote(this)" id="up_4156127"> <img vspace="3" hspace="2" border="0" src="http://ycombinator.com/images/grayarrow.gif"> </a> The vote function looks like this: function vote(node) { var v = node.id.split(/_/); // {'up', '123'} var item = v[1]; // hide arrows byId('up_' + item).style.visibility = 'hidden'; byId('down_' + item).style.visibility = 'hidden'; // ping server var ping = new Image(); ping.src =…

How HN's upvote link works launched on June 25, 2012 with 11 votes, #111 of 409 launches that month and more than 50% of that year's launches. The site was not reachable when checked in September 2026.

In plain words

This post explains how Hacker News implements its voting system technically. When a user clicks an upvote or downvote arrow on a story, JavaScript extracts the item ID from the link, hides both voting arrows to provide visual feedback, and sends a request to the server via an image ping. The technique is directed at developers interested in understanding web voting mechanisms and client-side interaction patterns used in popular platforms.

written from the facts on this page · September 2026

From the sources

In the maker’s words, at launch

Each link has an anchor tag like this: <a href="vote?for=4156127&dir=up&by=asto&auth=12345&whence=%6e%65%77%73" onclick="return vote(this)" id="up_4156127"> <img vspace="3" hspace="2" border="0" src="http://ycombinator.com/images/grayarrow.gif"> </a> The vote…

Does a similar job

all alternatives →
  • AW
    A Way To Hack HN's Karma2012 · ▲472

    I submitted a link, when someone clicks on it I get an up-vote for this article. I don't want people to misuse this I just want to bring attention to this problem. This is the link I used that up-votes this: http://news.ycombinator.com/vote?for=3742742&dir=up&...

  • TU
    This up votes itself2012 · news.ycombinator.com · ▲3,531
  • Export HN saved links (upvotes) as JSON or CSV2016 · github.com · ▲82

    Export your saved links on HN as JSON or CSV, with only a few keystrokes. - amjd/HN-Saved-Links-Export

  • Clickvote2023 · clickvote.dev · ▲312

    Like, upvote and review any context

  • I made a tool to track the upvote/ranking history of HN submissions2021 · upvotetracker.com · ▲144

    upvotetracker adalah situs berita yang menyajikan laporan terbaru dari berbagai topik dengan analisis yang cepat, jelas, dan mudah diikuti pembaca.

  • HR
    HN Rank Chrome extension2015 · jitbit.com · ▲26

    Chrome extension that shows you how many times a website has been upvoted on HackerNews.

More life & fun this month

the category →

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, June 2012

the whole month →