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 5 <img src="https://cachet.dunkirk.sh/emojis/ycombinator/r" height="175" align="right" alt="ycombinator logo"> 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) 8 9 - ## 🚀 Features 10 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 17 18 - ## 🚧 Development Setup 19 20 - ### Prerequisites 21 - 22 - - [Bun](https://bun.sh/) (JavaScript runtime and package manager) 23 - - PostgreSQL database 24 - - Ngrok for local development with Slack 25 26 - ### Local Development 27 28 - 1. Clone the repository: 29 30 ```bash 31 - git clone https://github.com/taciturnaxolotl/hn-alerts.git 32 - cd hn-alerts 33 ``` 34 35 - 2. Install dependencies: 36 37 ```bash 38 - bun install 39 ``` 40 41 - 3. Create a `.env` file with the following variables: 42 43 ```bash 44 SLACK_BOT_TOKEN="xoxb-xxxxx-xxxxx-xxxxx-xxxxx" ··· 46 SLACK_CHANNEL="C08KX2YNN87" 47 NODE_ENV="dev" 48 SENTRY_DSN="https://xxxxxx@xxxxxx.ingest.us.sentry.io/xxxx" 49 - DATABASE_URL="postgres://user:password@host:5432/table_name" 50 ``` 51 52 - 4. Initialize the database schema: 53 54 ```bash 55 bun db:push 56 ``` 57 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 ## 📱 Slack Commands 73 74 - `/hn-alerts-link your_username` - Link your Hacker News account 75 - - `/hn-alerts-link verify` - Verify your Hacker News account 76 - `/hn-alerts-link unlink` - Remove your linked account 77 - `/hn-alerts-link help` - Show command help 78 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 ## 📜 License 88 89 - The code is licensed under `MIT`! See the [LICENSE.md](LICENSE.md) file for more details. 90 91 <p align="center"> 92 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
··· 4 5 <img src="https://cachet.dunkirk.sh/emojis/ycombinator/r" height="175" align="right" alt="ycombinator logo"> 6 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" 11 12 + ## 🔥 What it does 13 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: 15 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 20 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) 27 28 + ## 🚧 Dev 29 30 + You can launch the bot locally with bun 31 32 ```bash 33 + bun install 34 + bun dev 35 ``` 36 37 + you will also need to launch an ngrok tunnel and update your dev slack manifest to point to the ngrok tunnel 38 39 ```bash 40 + bun ngrok 41 ``` 42 43 + you also need to create a `.env` file with the following keys 44 45 ```bash 46 SLACK_BOT_TOKEN="xoxb-xxxxx-xxxxx-xxxxx-xxxxx" ··· 48 SLACK_CHANNEL="C08KX2YNN87" 49 NODE_ENV="dev" 50 SENTRY_DSN="https://xxxxxx@xxxxxx.ingest.us.sentry.io/xxxx" 51 ``` 52 53 + Don't forget to initialize your database: 54 55 ```bash 56 bun db:push 57 ``` 58 59 ## 📱 Slack Commands 60 61 - `/hn-alerts-link your_username` - Link your Hacker News account 62 + - `/hn-alerts-link verify` - Verify your Hacker News account (post the challenge code to your HN profile) 63 - `/hn-alerts-link unlink` - Remove your linked account 64 - `/hn-alerts-link help` - Show command help 65 66 ## 📜 License 67 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. 69 70 <p align="center"> 71 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
+4 -4
public/index.html
··· 50 <meta property="og:title" content="HN Alerts Dashboard" /> 51 <meta 52 property="og:description" 53 - content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts." 54 /> 55 <meta property="og:image" content="/public/og.png" /> 56 <meta 57 property="og:image:alt" 58 - content="HN Alerts - Real-time Hacker News Monitoring" 59 /> 60 <meta property="og:image:width" content="1200" /> 61 <meta property="og:image:height" content="630" /> ··· 66 <meta name="twitter:title" content="HN Alerts Dashboard" /> 67 <meta 68 name="twitter:description" 69 - content="Real-time monitoring and analytics for Hacker News stories. Track performance metrics and get alerts for trending posts." 70 /> 71 <meta name="twitter:image" content="/public/og.png" /> 72 <meta 73 name="twitter:image:alt" 74 - content="HN Alerts - Real-time Hacker News Monitoring" 75 /> 76 77 <link
··· 50 <meta property="og:title" content="HN Alerts Dashboard" /> 51 <meta 52 property="og:description" 53 + content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!" 54 /> 55 <meta property="og:image" content="/public/og.png" /> 56 <meta 57 property="og:image:alt" 58 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 59 /> 60 <meta property="og:image:width" content="1200" /> 61 <meta property="og:image:height" content="630" /> ··· 66 <meta name="twitter:title" content="HN Alerts Dashboard" /> 67 <meta 68 name="twitter:description" 69 + content="Your personal Hacker News tracker! Get notified when your posts hit the front page and track their performance in real-time!" 70 /> 71 <meta name="twitter:image" content="/public/og.png" /> 72 <meta 73 name="twitter:image:alt" 74 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 75 /> 76 77 <link
+6 -8
public/item.html
··· 62 /> 63 <meta 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" 67 /> 68 <meta property="og:image" content="/public/og.png" /> 69 <meta 70 property="og:image:alt" 71 - content="HN Alerts - Story Performance Tracking" 72 - id="og-image-alt" 73 /> 74 <meta property="og:image:width" content="1200" /> 75 <meta property="og:image:height" content="630" /> ··· 84 /> 85 <meta 86 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" 89 /> 90 <meta name="twitter:image" content="/public/og.png" /> 91 <meta 92 name="twitter:image:alt" 93 - content="HN Alerts - Story Performance Tracking" 94 - id="twitter-image-alt" 95 /> 96 97 <link
··· 62 /> 63 <meta 64 property="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 /> 68 <meta property="og:image" content="/public/og.png" /> 69 <meta 70 property="og:image:alt" 71 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 72 /> 73 <meta property="og:image:width" content="1200" /> 74 <meta property="og:image:height" content="630" /> ··· 83 /> 84 <meta 85 name="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!" 88 /> 89 <meta name="twitter:image" content="/public/og.png" /> 90 <meta 91 name="twitter:image:alt" 92 + content="a screenshot of the app with graphs for my friend cyao's ice pi!" 93 /> 94 95 <link