nowfound

Dev tools · April 4, 2021

IW

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

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…

What it does

In the maker’s words, at launch

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.

Does the same job

all alternatives →
  • DiscussBot2019 · ▲250

    Telegram's web comment widget

  • GL
    Get latest replies to an HN user2022 · github.com · ▲42

    Hi HN, I hacked a simple service for gathering HN replies and organizing them by the parent's username. The main idea is to be able to efficiently get the latest replies to an HN user. For example, you can use this service to send yourself notifications when some replies to you on HN. The service queries the official HN API and can be self-hosted. It is basically ~30 lines of Bash script. I made this mostly for educational purposes -- thought you might find it useful for something. Cheers! Edit: for example, here are the latest replies to me [0]. It includes only recent replies, since I…

  • AD
    A Discord/Slack bot to watch HN comments2025 · newsbutler.xyz · ▲5

    Some years ago, I discovered a bot called Little Birdie to watch HN comments for keywords and post a link to Slack. Unfortunately, it has disappeared and I've found myself missing this. So this bot is a re-implementation of it, but now also supporting Discord. It's very easy to use: 1. install the bot on your workspace/guild 2. /keywords add rust,hn,foobar (for Discord) ; @newsbutler add rust,hn,foobar (for Slack) 3. done For technical stuff : it is implemented in Crystal + Postgres (hosted on Render+Neon). I will certainly opensource it when I clean the repo of all production…

  • HN buzz2021 · ▲76

    Telegram bot for Hacker News posts filtered by your keywords

  • SH
    Show HN my Hackathon Project: Visual Craigslist w/ HN's algorithm2011 · 5thavenue.chartboost.com · ▲42

    The concept was to rethink the way we browsed Craigslist and shopped online. The main section, the "homepage" is a tree map of recent craigslist posting sorted by popularity using a slightly modified version of Hacker News' ranking algorithm. The newest page is a masonry view of the realtime stream of the craiglist posts as they are added to the system (much like Hacker News' newest page.) The top page is the masonry view version of the homepage. The game page is a FaceMash-like game for the posts, which influences the overall scores and popularity of items.

  • HO
    HN on IRC2015 · ▲6

    irc://irc.freenode.org/#hn has a bot that copies the title and url of each HackerNews news almost as soon as they are published. Sources at: https://gitlab.com/com-informatimago/com-informatimago/tree/master/small-cl-pgms/botihn

More dev tools this month

the category →
  • Dograh592

    The open source VAPI alternative

    Dev tools · 25d ago · dograh.com

  • Meridian530

    Don't let your work go unnoticed. Get promoted!

    Dev tools · 20d ago · meridiona.com

  • x1516

    Lovable for iPhone apps go from idea to App Store

    Dev tools · 11d ago · x1.new

  • Open-source GTM skills for technical founders

    Dev tools · 29d ago · gtmcofounder.com

  • OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.

    Dev tools · 1d ago · opentrailpaper.com

  • Nuphos380

    The AI-Native DevOps Workspace.

    Dev tools · 24d ago · nuphos.ai

Launched alongside, April 2021

the whole month →
  • LC
    Lofi.cafe1,192

    Life & fun · 2021 · lofi.cafe

  • Mighty935

    Make Chrome faster and use 10x less memory

    Work · 2021 · playgroundai.com

  • An online whiteboard from Figma designed for teams

    Work · 2021 · figma.com

  • Butter848

    All-in-one tool for the smoothest virtual workshops 🧈

    Work · 2021

  • Build your landing page with these 100+ tools

    Growth · 2021 · landingpage.fyi

  • PF

    Life & fun · 2021 · pdf.math.dev