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

(polliticalscience.vote)

21 points by ps2026 6 hours ago

33 comments

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.

ps2026 an hour ago

Update: The HN traffic exposed a bug I hadn't caught... static caching of user-specific data in Blazor Server was causing session bleed under load. One comment got attributed to the wrong user. I am pushing a fix now, so the site will be down for a few minutes while it deploys.

If you posted a comment about "people find themselves in situations that shape their fate" and it's not showing under your username, you can email me at hello@polliticalscience.vote and I'll fix it.

  • ps2026 14 minutes ago

    Dang, perfect timing, ran into an issue with GitHub actions being down. Then the container timed out in Azure after manual publish. Should be back up now.

oersted 3 hours ago

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.

  • observationist 3 hours ago

    One of the reasons is that the US pays for a whole lot of those international institutions, creating policy and governance issues that end up beyond local accountability. The "force for good, or fairly harmless" rubric changes when it's your money. Then it becomes "why are they spending my money on that bullshit when we have fires to put out at home?"

    Covid era politicization and the fallout from that has a lot to do with it as well.

    • oersted 2 hours ago

      Thank you that makes sense. I did a bit more research for context:

      The US only left in 2020 and then rejoined in 2021, I suppose that’s why I didn’t remember it as a big thing.

      The US was also just paying ~15%. It was the biggest governmental funder, with Germany at ~9% as the second. But the WHO is apparently mostly funded by charity donations, the Bill & Melinda Gates Foundation was paying ~5% for instance.

      (it’s awkward to list sources on the phone but should be easy to verify)

      I do get the sentiment though from the perspective of the US, I don’t mean to argue your points.

  • ps2026 3 hours ago

    Thanks for checking it out!

    Most of my voters have come from Reddit and Bluesky so far, which is primarily where the left leaning is coming from. My X account was unfortunately suspended lol. I put an appeal in, but was originally flagged I think do to a new account, political content, and lots of links to the polls. I use an OG dynamic card generator so if I post a link to that poll or result, it creates a card for it on the fly. I think X didn't like that since I wasn't established.

    That one was interesting, I am not really sure why that one skewed so far the other directly. I did not have the discussion section open yet (and just slowly getting a few active users), but that was the original reason I added the discussion. I don't know who users are, what their demographics are, etc.. (and I don't want to store that info), so hopefully in the future polls like that people will explain the "why".

    I need to build some more analytics into the site (both frontend and backend) so I can analyze the data and visualize it, and so users on the frontend can get better ideas on what is happening.

crazygringo 2 hours ago

This is cool. My main question is just, what is its purpose, if not just a coding experiment?

Like you say, it's not scientific or representative. Is it for entertainment, do you want to gamify it? Is it pedagogical? Why is it anonymous? Do you want it to get picked up by the media? Are you trying to demonstrate something about public opinion or polarization? Do you want it to become popular? Do you want it to become more accurate? Or is it just a toy?

I have so many questions just because it could be so many different things, and the idea of a single daily poll on the main current event feels like it could have legs. (Though I don't know what today's poll about the death penalty has anything to do with today's or yesterday's news cycle?)

Very clever domain name btw.

  • ps2026 2 hours ago

    I am not really sure honestly. I thought of the idea a couple years ago and thought it was interesting. I follow politics and current events, but never really participated in online discussions of it. I have a background in data analytics and have loved stats since I was a kid. I always followed sports stats and election poll stats. I have been working on an enterprise application for ~ 3 years now, that I hope to beta test this year and it has been pretty heavy. I decided to take a short break and just get this idea I had out there and see how it goes.

    The reason it is anonymous is I do not want to tie users to votes. A couple reasons being liability. If I know who you are, how you are voting, and your demographics, that is pretty powerful, but also a ton of liability. If something happened and that data got leaked out, that could be awful. I also don't think users are as likely to create an account, give away their information, just to hit two big buttons. The goal was no barrier to entry, sign up if you want more and not to farm political data from users.

    Of course I would like it to become popular, be a place for thousands to discuss hot topics, and get enough votes that it washes out any abuse and grabs enough diversity to see real sentiment. I don't know if it will ever get to that point though. I don't plan to make it scientific as that would require removing the anonymous nature of it. I have thought about it as a free tool for universities or high schools to use for current events polls and discussions.

    The short version, I have no idea haha. It really is a fun side project for now, it was fun to code and get something out there, but I am interested to see where it goes.

    • crazygringo 2 hours ago

      Interesting, thanks.

      I think that if you keep it anonymous like that, then it's limited to basically being a toy, since there's zero accuracy, nothing to prevent "ballot-stuffing", etc. Which is fine, if you just want to have built it for fun.

      But if you wanted to, I do think this is an idea that could take off in a popular way, the idea of America's "question of the day" that people answer every morning after they do their Wordle (or their enclose.horse, ha). But it would require creating an account linked to probably a phone number, that you log in with via a code, and answer basic demographic questions after your first vote that you'd use for balancing. I don't think you need to worry too much about liability if you follow best practices around database security? (And if it really took off, you could put it behind a cheap LLC to protect you personally.) Obviously you don't want people to think you're selling their data to political operatives, so you might want to partner with a political scientist at some well-known university to give some kind of "academic seal of approval" that this is used for research and public information, not for selling data. I think there could really be something here, and let people suggest and vote on what tomorrow's question should be.

      Just something to think about, if you did want to try to turn it into something popular that could become part of the news environment, the way FiveThirtyEight has. But if you value the anonymous aspect the most and just want to keep it as something smaller for fun, then that's cool on its own. :)

      • ps2026 2 hours ago

        Thanks for the thoughtful ideas! You make some great points and laid out a few good plans honestly. I do have an "account" feature right now, where you just enter your email to login. It is passwordless. Logged in accounts can only vote 1 time. I still have the fundamental difficulty of not knowing what they actually voted to maybe have two counts, the anonymous vote and the logged in vote.

        Maybe if this somehow takes off, I can re-evaluate if there is a better way to maybe have the anonymous voting as well as a more "scientific" version where users opt-in to provide their information or a way to verify it before anonymously storing their vote.

kjshsh123 3 hours ago

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.

  • ps2026 3 hours ago

    That would actually be really interesting since most of my users so far are from Reddit and Bluesky. Seeing how that breaks down would be telling of how sites primary users feel.

    The only issue is, while Plausible analytics that I am using is really nice since it is privacy focused and doesn't track people, I have noticed it doesn't do a great job of understanding what links brought someone there. I am sure Google Analytics or others would do a better job, but it sort of circumvents the anonymous idea. Especially since this is a side project mostly for fun/interesting, I don't really want to be responsible for linking people to political choices.

    • 1e1a 3 hours ago

      Plausible is probably just looking at the Referer header.

FranchuFranchu 2 hours ago

You should probably say somewhere that the questions are US-centric. For example, "the death penalty should remain legal" doesn't make sense in places where it isn't.

  • ps2026 an hour ago

    I should probably add that. I do plan to add some more international statements, but yeah, right now it is very U.S.-centric.

boldslogan 3 hours ago

feature request? dumb question, but can you add underneath or after you click your vote and before you show it. can you ask "What do you think most people answered" for that question.

It is cool to see the distribution of yes/no. But maybe when you do that you can do a kind of....how far off was i type result that lets people learn about their...biases? or just a fun surprise.

Anyways fun idea!

  • ps2026 3 hours ago

    Haha so like "guess" which way you think public sentiment leans before you submit your vote? Were you thinking like "what percent agreed" or something? You type 55% then it shows you actually 22% agree sort of deal?

    That could maybe be a little optional thing to make it more "interactive". The original idea was to be dead simple, two big buttons. The issue is attracting people to come back since they hit the big button, go "that's interesting", then forget it ever existed.

    • boldslogan 3 hours ago

      The death penalty should remain legal. Yes/No

      user clicks Yes. new one pops up Show Results (button) or Guess which was more popular: Yes/No. This is more simple than guessing a percentage. but both could work.

      So you then show the results and then you show the "meta" results which is like a "line" that is labelled where it shows what others thought of other people. The dead simple idea is a nice draw, this like...ah hah learning moment to learn or see more about the world I think is maybe a nice feature to add. to get more people to come back?

1e1a 4 hours ago

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?

  • ps2026 3 hours ago

    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.

    • 1e1a 3 hours ago

      Awesome! I'm excited to see how this goes.

bflesch 4 hours ago

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".

  • joekrill 4 hours ago

    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.

    • ps2026 3 hours ago

      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.

      • 1e1a 3 hours ago

        Are you rate limiting at the subnet/prefix level for IPv6?

    • bflesch 2 hours ago

      On the landing page, right underneath the "disagree" button it says "no tracking"

  • ps2026 3 hours ago

    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.

    • bflesch 2 hours ago

      GDPR is not about cookies it is about you giving user data to another company, and by including plausible.io you are doing that.

      • ps2026 2 hours ago

        I guess I will have to dive into this a bit more. I don't want to make false claims on the site. From the research I did before choosing Plausible, they do not collect any user data. They collect statistics of things that happened, but no actual user data.

        From their website:

        "By using Plausible, you don’t need to have any GDPR, CCPA or PECR prompts and you don’t need a complex privacy policy about your use of analytics and cookies. With Plausible, you are not tracking any personal data after all. Your visitors can enjoy your site without any annoyances and distractions."

        You can't even tell if the same person comes back on a different day.

        You can see their full privacy statements here: https://plausible.io/privacy-focused-web-analytics.

        Honestly, I don't even really need them. I may just remove it entirely. I am not a B2C or B2B website. It doesn't really matter to me that much to have the stats, but it is nice in general to see how it is doing. The votes submitted sort of count the users for me anyways.

[removed] 6 hours ago
[deleted]