Show HN: I wrote an HN bot to suggest HTTPS url when people post HTTP URLs

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • https-bot

    Find http urls that can be safely replaced by https url

  • It's inspired by this comment I made: https://news.ycombinator.com/item?id=26599746.

    I actually saw several comments with HTTP URL posted, and that was the only one I bothered to comment on. So I thought that this is something better suited for bots than human.

    I hacked this together over yesterday and today: https://github.com/fishy/https-bot.

    Basically it uses the Firebase API (https://github.com/HackerNews/API) to find comments with HTTP URLs in them, try the HTTPS version, compare the contents, post back a comment if the contents are more than 95% similar.

    The "95% similar" part was actually the first part I wrote in the code. At first I tried a few existing go packages implementing diff/lcs, but most of them was quite slow and does a lot of allocations when I'm comparing two randomly generated 10KiB blobs, so I wrote my own (https://pkg.go.dev/github.com/fishy/https-bot/similarity), which is optimized for space (it does almost no allocations), and it's also faster because allocations are slow. (I know this is an unfair comparison that most of the existing implementations need to give you an output that can be used to reconstruct the two blobs back, so at least some of their allocations are required and unavoidable)

    I also wrote a bug that it would find the same HTTP url in every run and post the same comment over and over again. My apologize to dang or whoever dealt with it (or maybe the system is good enough that it blocked those repetitive comments automatically).

    In the end it successfully made 6 comments across ~4 hours (not including the repetitive ones). All of those comments are flagged (likely due to hn policy), https://news.ycombinator.com/item?id=26692588 is the only one that's still visible to other users at the time of writing, if you are curious.

    I just killed it completely from the request of dang. Although it only lived for a few hours, it's still a fun exercise. Maybe I'll convert it into a reddit bot next? Who knows.

  • Hacker News API

    Documentation and Samples for the Official HN API

  • It's inspired by this comment I made: https://news.ycombinator.com/item?id=26599746.

    I actually saw several comments with HTTP URL posted, and that was the only one I bothered to comment on. So I thought that this is something better suited for bots than human.

    I hacked this together over yesterday and today: https://github.com/fishy/https-bot.

    Basically it uses the Firebase API (https://github.com/HackerNews/API) to find comments with HTTP URLs in them, try the HTTPS version, compare the contents, post back a comment if the contents are more than 95% similar.

    The "95% similar" part was actually the first part I wrote in the code. At first I tried a few existing go packages implementing diff/lcs, but most of them was quite slow and does a lot of allocations when I'm comparing two randomly generated 10KiB blobs, so I wrote my own (https://pkg.go.dev/github.com/fishy/https-bot/similarity), which is optimized for space (it does almost no allocations), and it's also faster because allocations are slow. (I know this is an unfair comparison that most of the existing implementations need to give you an output that can be used to reconstruct the two blobs back, so at least some of their allocations are required and unavoidable)

    I also wrote a bug that it would find the same HTTP url in every run and post the same comment over and over again. My apologize to dang or whoever dealt with it (or maybe the system is good enough that it blocked those repetitive comments automatically).

    In the end it successfully made 6 comments across ~4 hours (not including the repetitive ones). All of those comments are flagged (likely due to hn policy), https://news.ycombinator.com/item?id=26692588 is the only one that's still visible to other users at the time of writing, if you are curious.

    I just killed it completely from the request of dang. Although it only lived for a few hours, it's still a fun exercise. Maybe I'll convert it into a reddit bot next? Who knows.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • https-everywhere

    Discontinued A browser extension that encrypts your communications with many websites that offer HTTPS but still allow unencrypted connections.

  • distroless

    🥑 Language focused docker images, minus the operating system.

  • My code only use the 10KiB blobs for comparison, so as long as I don't have any buffer overflow bug the actual content doesn't matter. Even if I had a buffer overflow bug, I'm running the code through Docker with distroless based image [0], so that helps a little as well. I guess I can also change docker's runtime from runc to runsc [1] to help mitigate further, but I don't really see that as necessary as it's quite hard to have buffer overflow bugs in go code.

    [0]: https://github.com/GoogleContainerTools/distroless

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Vademecum di Privacy e Sicurezza - Parte 1

    1 project | /r/italy | 13 Feb 2023
  • New Release: Tor Browser 11.5

    1 project | news.ycombinator.com | 15 Jul 2022
  • Do I need the HTTPSEverywhere extension now that Firefox natively has a HTTPS-Only mode?

    1 project | /r/firefox | 18 Jun 2021
  • Hi..What does this software mean?... THANK YOU!✨

    1 project | /r/AskComputerScience | 16 Jun 2021
  • HTTPS Everywhere seems to slow down the chromium browser in Arch repos

    2 projects | /r/archlinux | 8 Apr 2021