hacker news alerts in slack (incessant pings if you make front page)

docs: update meta and readme

dunkirk.sh e5bb9625 3de6f325

verified
+36 -59
+26 -47
README.md
··· 4 4 5 5 <img src="https://cachet.dunkirk.sh/emojis/ycombinator/r" height="175" align="right" alt="ycombinator logo"> 6 6 7 - A Slack bot that tracks when you make it to the front page of Hacker News, made with ๐Ÿ’– @ [Hack Club](https://github.com/hackclub) 7 + > ### Your personal Hacker News success tracker ๐Ÿ“ˆ ๐Ÿ”” ๐Ÿš€ 8 + > A slack bot that tracks when you make it to the front page of Hacker News; developed with ๐Ÿ’– @ [Hack Club](https://github.com/hackclub) 9 + > 10 + > โš ๏ธ **Highly optionated / mad teenager rants at computer warning** - From "I wish I had this" to "now we all do" 8 11 9 - ## ๐Ÿš€ Features 12 + ## ๐Ÿ”ฅ What it does 10 13 11 - - **Front Page Tracking**: Get notified when your posts reach the Hacker News front page 12 - - **#1 Post Alerts**: Special notifications when your post reaches the coveted #1 position 13 - - **Leaderboard History**: Track how your posts perform over time with rank and point history 14 - - **Web Dashboard**: View all currently tracked stories and their stats 15 - - **Individual Story Pages**: View detailed information about any story using HN-compatible URLs 16 - - **User Verification**: Securely link your HN account with Slack using verification phrases 14 + HN Alerts watches Hacker News for you and anyone else that chooses to trust your instructions to run `/hn-alerts-link`, notifying you through Slack when: 17 15 18 - ## ๐Ÿšง Development Setup 16 + - Your posts appear on the front page (top 30) 17 + - Your posts climb the rankings 18 + - Your posts reach the coveted #1 position ๐Ÿ† 19 + - Any significant changes to your post's performance 19 20 20 - ### Prerequisites 21 - 22 - - [Bun](https://bun.sh/) (JavaScript runtime and package manager) 23 - - PostgreSQL database 24 - - Ngrok for local development with Slack 21 + The dashboard provides: 22 + - Real-time position tracking with historical graphs 23 + - Performance metrics (peak position, time on front page, comment activity) 24 + - Leaderboard of all tracked stories 25 + - Detailed analytics for each post's journey 26 + - An excellent caching mechanism (this took me so very long to implement) 25 27 26 - ### Local Development 28 + ## ๐Ÿšง Dev 27 29 28 - 1. Clone the repository: 30 + You can launch the bot locally with bun 29 31 30 32 ```bash 31 - git clone https://github.com/taciturnaxolotl/hn-alerts.git 32 - cd hn-alerts 33 + bun install 34 + bun dev 33 35 ``` 34 36 35 - 2. Install dependencies: 37 + you will also need to launch an ngrok tunnel and update your dev slack manifest to point to the ngrok tunnel 36 38 37 39 ```bash 38 - bun install 40 + bun ngrok 39 41 ``` 40 42 41 - 3. Create a `.env` file with the following variables: 43 + you also need to create a `.env` file with the following keys 42 44 43 45 ```bash 44 46 SLACK_BOT_TOKEN="xoxb-xxxxx-xxxxx-xxxxx-xxxxx" ··· 46 48 SLACK_CHANNEL="C08KX2YNN87" 47 49 NODE_ENV="dev" 48 50 SENTRY_DSN="https://xxxxxx@xxxxxx.ingest.us.sentry.io/xxxx" 49 - DATABASE_URL="postgres://user:password@host:5432/table_name" 50 51 ``` 51 52 52 - 4. Initialize the database schema: 53 + Don't forget to initialize your database: 53 54 54 55 ```bash 55 56 bun db:push 56 57 ``` 57 58 58 - 5. Start the development server: 59 - 60 - ```bash 61 - bun dev 62 - ``` 63 - 64 - 6. In a separate terminal, launch ngrok to expose your local server: 65 - 66 - ```bash 67 - bun ngrok 68 - ``` 69 - 70 - 7. Update your Slack app's manifest in `manifest.dev.yaml` to point to your ngrok URL 71 - 72 59 ## ๐Ÿ“ฑ Slack Commands 73 60 74 61 - `/hn-alerts-link your_username` - Link your Hacker News account 75 - - `/hn-alerts-link verify` - Verify your Hacker News account 62 + - `/hn-alerts-link verify` - Verify your Hacker News account (post the challenge code to your HN profile) 76 63 - `/hn-alerts-link unlink` - Remove your linked account 77 64 - `/hn-alerts-link help` - Show command help 78 65 79 - ## ๐Ÿงฐ Tech Stack 80 - 81 - - [Bun](https://bun.sh/) - JavaScript runtime and package manager 82 - - [Slack Edge](https://github.com/slack-edge/slack-edge) - Slack API client 83 - - [Drizzle ORM](https://orm.drizzle.team/) - Database ORM 84 - - [Sentry](https://sentry.io/) - Error tracking 85 - - [Cron](https://github.com/kelektiv/node-cron) - Scheduled tasks 86 - 87 66 ## ๐Ÿ“œ License 88 67 89 - The code is licensed under `MIT`! See the [LICENSE.md](LICENSE.md) file for more details. 68 + The code is licensed under `MIT`! That means MIT allows for free use, modification, and distribution of the software, requiring only that the original copyright notice and disclaimer are included in copies. 90 69 91 70 <p align="center"> 92 71 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
+4 -4
public/index.html
··· 50 50 <meta property="og:title" content="HN Alerts Dashboard" /> 51 51 <meta 52 52 property="og:description" 53 - content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts." 53 + content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!" 54 54 /> 55 55 <meta property="og:image" content="/public/og.png" /> 56 56 <meta 57 57 property="og:image:alt" 58 - content="HN Alerts - Real-time Hacker News Monitoring" 58 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 59 59 /> 60 60 <meta property="og:image:width" content="1200" /> 61 61 <meta property="og:image:height" content="630" /> ··· 66 66 <meta name="twitter:title" content="HN Alerts Dashboard" /> 67 67 <meta 68 68 name="twitter:description" 69 - content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts." 69 + content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!" 70 70 /> 71 71 <meta name="twitter:image" content="/public/og.png" /> 72 72 <meta 73 73 name="twitter:image:alt" 74 - content="HN Alerts - Real-time Hacker News Monitoring" 74 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 75 75 /> 76 76 77 77 <link
+6 -8
public/item.html
··· 62 62 /> 63 63 <meta 64 64 property="og:description" 65 - content="Detailed analytics and performance tracking for individual Hacker News stories. View engagement metrics, rankings, and real-time data." 66 - id="og-description" 65 + content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts." 66 + content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!" 67 67 /> 68 68 <meta property="og:image" content="/public/og.png" /> 69 69 <meta 70 70 property="og:image:alt" 71 - content="HN Alerts - Story Performance Tracking" 72 - id="og-image-alt" 71 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 73 72 /> 74 73 <meta property="og:image:width" content="1200" /> 75 74 <meta property="og:image:height" content="630" /> ··· 84 83 /> 85 84 <meta 86 85 name="twitter:description" 87 - content="Detailed analytics and performance tracking for individual Hacker News stories. View engagement metrics, rankings, and real-time data." 88 - id="twitter-description" 86 + content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts." 87 + content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!" 89 88 /> 90 89 <meta name="twitter:image" content="/public/og.png" /> 91 90 <meta 92 91 name="twitter:image:alt" 93 - content="HN Alerts - Story Performance Tracking" 94 - id="twitter-image-alt" 92 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 95 93 /> 96 94 97 95 <link