11 ms·
there are many sample scripts already available to do this depending on what language you are using. everytime a vote is done, you would capture that users IP
by _ud4a 15y ago
there are many sample scripts already available to do this depending on what language you are using.
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.
- hhimanshu 15y ago@soho33, I am using python, django, google app engine. I am sorry but I don't find any thing online, honestly I don't even know how to search for it :(
- fduran 15y agoTo get the IP address in Django you can do: ip = request.META.get('REMOTE_ADDR', '') https://docs.djangoproject.com/en/dev/ref/request-response/ https://docs.djangoproject.com/en/dev/ref/request-response/
- callmeed 15y agoDoesn't that prevent 2 people behind the same router (or work IP) from voting?
- _ud4a 15y agothat's true. maybe he can store the source port as well along with the IP? the source port will always be different even if behind the same router.