Re:A Hacker News vote button
by TazeTSchnitzel on Sunday November 25, 2012 @05:20AM
(#4827817)
So how does this work? Does hnbutton.appspot.com do some clever proxying, or something? Or does HN just have a very easily exploitable XSRF vulnerability?
[ Parent
| on HN ]
Re:A Hacker News vote button
by cxhristian on Sunday November 25, 2012 @07:42AM
(#4828032)
From what I can understand, looking at one site that uses the button[0], it just displays current votes and links you to the submission. It doesn't do any voting from the site like a reddit button would do.
[0] https://bountify.co/blog/host-your-own-hacker-news-button-se...
My answer to GP looks silly now. I see what he meant. The submission title should change to vote-counter button to avoid the confusion.
I also don't understand how it works. If you could up-vote just by following a link, you could easily gain a system. For example, you could submit a story that automatically up-votes itself when visited by logged-in user, without any button press (CSRF). I believe Facebook like button (and other similar gadgets) are iframes from Facebook. So Facebook controls how the button looks like and it is not possible to submit 'Like' requests from a third party domain.
http://news.ycombinator.com/item?id=3742902
EDIT: This is a submission from a while ago that does, in fact, upvote itself.
They use the search API. https://github.com/igrigorik/hackernews-button/blob/master/h...