TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Build a voting system,users vote without sign up, only once

9 pointsby hhimanshuover 13 years ago
I am implementing a suggestion system where a user can vote suggestions by other people(much like what we see on ycombinator) but here is the problem:<p>- I don't want the users to signup before they vote(why? I dont want user to bother in the very first place to signup to vote, its not convenient) - for a particular suggestion I just want them to vote ONCE, they can vote all suggestions on a page, but not more than once<p>Is it a way to achieve this? I am working on my first app and want to learn how to do this<p>Thank you people

5 comments

bradbeattieover 13 years ago
Persistent cookies can easily be cleared. IP address limitations might prevent legitimate users behind firewalls, while allowing others to vote multiple times if they have access to multiple computers.<p>I've looked into the problem for my own voting site (<a href="https://modernballots.com/" rel="nofollow">https://modernballots.com/</a>) and I haven't found a good way of doing this for public polls where anyone's allowed to vote.<p>The solution I developed was to just create the option for private elections that require invitations to vote in. This has its own issues (most notably the distribution of invitation keys), but it's worked so far.<p>Long story short, there's no good way of doing what you're looking for unless you're willing to accept the risk of false positives, false negatives, and the problems that come with both.
dangrossmanover 13 years ago
Your first line of deduping will be cookies. When there's no cookie present, also check against (user agent, IP) pairs; remarkably unique at web scale. The chances of two people with the same browser on the same OS with the same plugins behind the same IP address hitting a random website are very small, and collateral damage is limited to not letting two people at a very IT-homogenous corporation vote on the same item.
评论 #3353992 未加载
callmeedover 13 years ago
Use an evercookie (or something similar): <a href="http://samy.pl/evercookie/" rel="nofollow">http://samy.pl/evercookie/</a>
ericingramover 13 years ago
It could be gamed a bit, but I think it's worth the trade off. I did something like this with a chat system (no login to post first), and it blew up. Avg 6,000 comments a day for a while, ~500,000 comments in a year.<p>++
_ud4aover 13 years ago
there are many sample scripts already available to do this depending on what language you are using.<p>everytime a vote is done, you would capture that users IP address and store it in a database with the ID of the question they voted for. In your algorithm, before each vote check the database to make sure the user IP and the question ID already doesn't exist.
评论 #3353473 未加载
评论 #3353471 未加载