Looped In is a browser extension that displays Hacker News comments for the current webpage in a sidebar. It is written in [ClojureScript](https://clojurescript.org).
Looped In is available from the [Chrome Web Store](TODO) and the [Firefox Add-ons site](TODO). If you'd prefer to clone the repository and run the extension locally, read on.
To build the source code once, navigate to the project root and run:
$ lein cljsbuild once
This will output the generated JavaScript to `ext/js/generated`.
To load the extension locally in your browser, see [instructions for Firefox](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox) or [instructions for Chrome](https://developer.chrome.com/extensions/getstarted#unpacked).
## Analytics
Looped In uses [Amplitude](https://amplitude.com) to track user actions such as clicking on a story or viewing replies to a comment. This data is useful for improving the program. However, some users find this tracking invasive, so Looped In respects the browser's [Do Not Track](https://www.w3.org/2011/tracking-protection/drafts/tracking-dnt.html) setting. If DNT is enabled, no analytics data is collected. To enable DNT, see [instructions for Firefox](https://support.mozilla.org/en-US/kb/how-do-i-turn-do-not-track-feature?redirectlocale=en-US&redirectslug=how-do-i-stop-websites-tracking-me) and [instructions for Chrome](https://support.google.com/chrome/answer/2790761).
If you are running the extension locally, you will either need to get an Amplitude API key or disable the analytics. The easiest way to disable the analytics is to edit the `src/looped_in/analytics.cljs` file. Delete the bodies of the `init-amplitude` and `log-event` functions. It should look something like this:
If you want to keep the analytics, you'll need an Amplitude API key. [Sign up for Amplitude](https://amplitude.com/signup?ref=nav) and follow the getting started guide to create a new project. Once you have the API key, create the file `profiles.clj` at the project root with the following content: