GitHub - HartS/gpt-hacker-news-extension: A complete, working Hacker News Extension to highlight new comments on a Hacker News Thread, completely generated by ChatGPT

2 min read Original article ↗

Hacker News Extension

This is a browser extension for Chrome that can be used to highlight new comments on Hacker News threads. The extension will only be enabled on Hacker News, and will keep track of which comments the user has already seen. When the user navigates to the same comment thread twice, comments that weren't visible on the page the last time the user looked at the thread will be highlighted.

How it works

The extension uses a content script to modify the DOM of the page, adding a highlight to any comments that were posted after the user's last visit to the thread. The timestamp of the user's last visit is stored in local storage, using the thread's ID as the key.

How it was created

This extension was created using ChatGPT, a large language model trained by OpenAI. The code was entirely generated by ChatGPT, and the only human intervention besides applying the changes and sharing GPT output was one suggestion to use the title attribute of the .age selector instead of the datetime or title attribute of the .age a selector.

The manifest.json file included in this repository was created by ChatGPT, but it resulted in an error when attempting to load the extension in Chrome. The human operator fixed the error by changing the manifest_version to 2, which allowed the extension to be loaded in development mode.

All commits to this repository contain the human prompt text verbatim in the commit message, and the ChatGPT-provided output from each prompt was appended to a log file named gpt-output.