Live data from Hacker News

Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

polliticalscience.vote

1–10 of 45 posts

Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#1
I have been building a Blazor WASM enterprise app for a few years now. I wanted a break from it and had an idea for a side project that had been in the back of my mind for a few years. A daily political poll where anyone can participate and privacy is a product, not a checkbox.

This is how it works. One question per day about current events. Agree or Disagree. Each poll runs for 24 hours (midnight to midnight ET) and then close permanently. You do not need an account to vote. The main idea is to capture sentiment at a specific point in time, before the news cycle moves on and people's opinions drift.

For this app, I tried to make privacy the point and not just a feature. I originally used a browser fingerprint for anonymous voting, but recently changed it to a simple first-party functional cookie. It uses a random string and the PollId to see if your browser had voted before. The server stores a hash of the cookie to check for duplicates while the poll is live, then deletes all hashes when the poll closes. Only the aggregate counts remain. The browser fingerprint had way too many device collisions where it would show someone they voted even though they had not (an odd thing to see when you go to a poll). The HttpOnly cookie is also available during prerender, which helped eliminate loading flashes I was getting.

This app was built with .NET 10 Blazor with a hybrid Static SSR + Interactive Server. The static pages (about, privacy, terms, etc...) don't need SignalR connections. The interactive ones (voting, archive, results, etc...) do. Mixing these modes was a new experience for me and ended up being pretty tricky. I ended up with data-enhance-nav="false" on most links to prevent weird state issues.

The two biggest things I learned during building this app was how to prevent weird blazor flashes and duplicate queries during pre-render, hydration, and state changes. I used the _ready pattern from preventing the hydration flashes (gate rendering until data is loaded by setting the flag before the first await). Preventing the duplicate queries was possible by using a 2-second static caching during prerender to hydration.

This isn't scientific polling and these are obviously not representative samples. The 24-hour window means smaller numbers than longer surveys and it's only a survey of those who choose to participate. The Agree/Disagree binary choice basically flattens nuance (like I sort of agree), but I am okay with all of this as I think a lot of people feel they never get to participate in these sorts of polls.

I recently also added discussions with AI moderation (Claude Haiku 4.5 as a "first-pass" filter which flags things clearly out of the community guidelines for human review), a reaction system where counts stay hidden until the discussion closes, and news coverage from across the political spectrum shown after you vote for more perspective on the topic.

Thanks for checking it out and happy to dig into any of the Blazor SSR patterns or anything else that sounded interesting. I know Blazor is less frequently used and especially for a public facing website. It did have its challenges, but so far, it has been a blast to work with overall.

Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows
polliticalscience.vote

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#4
Website says "no tracking" on the frontpage. I look at ublock origin, it mentions one blocked domain called "plausible.io". I go to plausible.io and see that "Easy to use and privacy-friendly Google Analytics alternative Plausible is powerful, lightweight analytics. No cookies, just insights. Made and hosted in the EU, powered by European-owned infrastructure. "

"No tracking" is a different concept than "Google analytics alternative".

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#5
post #4

Website says "no tracking" on the frontpage. I look at ublock origin, it mentions one blocked domain called "plausible.io". I go to plausible.io and see that "Easy to use and privacy-friendly Google Analytics alternative Plausible is powerful, lightweight analytics. No cookies, just insights. Made and hosted in the EU, powered by European-owned infrastructure. " "No tracking" is a different concept than "Google analy…

Maybe it was changed quickly, but I can't find anywhere that is says "No tracking". It specifically says "We don't track you around the internet." and "doesn't track you across sites" in the terms and about pages.

Also, you kind of have to "track" users to some extent for a site like this - otherwise it would be simply for someone to stuff votes.

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#6
I think it would be cool to track how votes differ depending on where a user was linked from. Being able to see e.g. "x% from hackernews support death penalty, y% from x". You wouldn't just be polling but also showing differences between users of different sites.

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#7
post #3

It would be cool to be able to see how sentiment changes for a specific issue over time. Maybe you could recycle questions every so often?

That is a great idea! So I actually have two "meta" tags that will be used as I get going more. One is "revisited". This one will tag statements that have been asked before and I'll then add in more analytics to see how sentiment shifts. The other one is "recurring". I'll likely ask some of the more boring straightforward "The country is headed in the right direction" statements. Then set up some charts to see how it tracks over time.

I am hoping the general public finds this interesting as a lot of the major polls (who to be fair do it scientifically) only ask a couple thousand people. Many never get to participate. While this is not scientific, anyone can participate and eventually with enough people, we can maybe gauge and see how sentiment shifts after time.

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#8
post #4

Website says "no tracking" on the frontpage. I look at ublock origin, it mentions one blocked domain called "plausible.io". I go to plausible.io and see that "Easy to use and privacy-friendly Google Analytics alternative Plausible is powerful, lightweight analytics. No cookies, just insights. Made and hosted in the EU, powered by European-owned infrastructure. " "No tracking" is a different concept than "Google analy…

So the site does use Plausable analytics. I chose that one because it does not use cookies, does not identify the user in any way, and does not follow you across the internet.

It counts raw aggregate statistics and is compliant with GDPR without requiring a banner. While it is "tracking" I suppose, it doesn't "track you". Do you think my wording doesn't work? I am open to suggestions.

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#9
Cool project! The results of all the archived votes made sense to me, but I was most surprised by this one:

> The U.S. was right to withdraw from the World Health Organization (WHO)

> 62% Agree - 38% Disagree

I didn't know that the WHO had such a negative reputation. We are quite fond of such international institutions in the EU at least (ranging from a force for good to fairly harmless). What's the context? The rest of the votes seem quite liberal leaning otherwise.

Re: Show HN: PolliticalScience – Anonymous daily polls with 24-hour windows

#10
post #5
post #4

Website says "no tracking" on the frontpage. I look at ublock origin, it mentions one blocked domain called "plausible.io". I go to plausible.io and see that "Easy to use and privacy-friendly Google Analytics alternative Plausible is powerful, lightweight analytics. No cookies, just insights. Made and hosted in the EU, powered by European-owned infrastructure. " "No tracking" is a different concept than "Google analy…

Maybe it was changed quickly, but I can't find anywhere that is says "No tracking". It specifically says "We don't track you around the internet." and "doesn't track you across sites" in the terms and about pages. Also, you kind of have to "track" users to some extent for a site like this - otherwise it would be simply for someone to stuff votes.

The Plausible does count raw statistics without "tracking" specific users. That is just used for general website analytics. The first-party functional cookie that I am using (very similar to the auth login cookie) is used to prevent duplicate anonymous votes. Neither of these track the user and both are for on-site only. The functional cookie works much better than the fingerprint (actually less invasive too), but isn't full proof. You can switch browsers, go to incognito mode in some browsers, etc.. to bypass it, but it works for most casual users. Since it isn't election level polling, I figured it is fine. I do have an in memory rate limit to prevent excessive voting spam.
Post reply on HN