Hacker News Throwback Machine - See What Was Hot on This Day, Every Year!

Discover what was trending on Hacker News on this exact day, every year, with the Hacker News Throwback Machine. This n8n workflow automates the process of fetching historical Hacker News front pages and summarizing the top stories, delivering a daily dose of tech nostalgia directly to your Telegram chat. A Schedule Trigger initiates the workflow, which then dynamically generates a list of past years. For each year, it uses an HTTP Request node to retrieve the Hacker News front page for today's date, then an HTML Extract Details node parses the headlines and links. These headlines are then compiled and fed into a Google Gemini Chat Model via a Basic LLM Chain, which summarizes the most interesting stories. Finally, the summarized insights are sent to your designated Telegram chat, providing a unique historical perspective without any manual effort. This workflow is perfect for tech enthusiasts, developers, or anyone curious about the evolution of tech news, saving significant time and effort compared to manually searching through archives.

13 nodesschedule trigger215 views0 copiesOther
Telegram

Workflow JSON

{"nodes": [{"id": "6ea4e702-1af8-407b-b653-964a519db1c2", "name": "Basic LLM Chain", "type": "@n8n/n8n-nodes-langchain.chainLlm", "position": [1560, -360], "parameters": {"text": "=You are a highly skilled news categorizer, specializing in indentifying interesting stuff from Hacker News front-page headlines.\n\nYou are provided with JSON data containing a list of dates and their corresponding top headlines from the Hacker News front page. Each headline will also include a URL linking to the original article or discussion. Importantly, the dates provided will be the SAME DAY across MULTIPLE YEARS (e.g., January 1st, 2023, January 1st, 2022, January 1st, 2021, etc.). You need to indentify key headlines and also analyze how the tech landscape has evolved over the years, as reflected in the headlines for this specific day.\n\nYour task is to indentify top 10-15 headlines from across the years from the given json data and return in Markdown formatted bullet points categorizing into themes and adding markdown hyperlinks to the source URL with Prefixing Year before the headline. Follow the Output Foramt Mentioned.\n\n**Input Format:**\n\n```json\n[\n {\n \"headlines\": [\n \"Headline 1 Title [URL1]\",\n \"Headline 2 Title [URL2]\",\n \"Headline 3 Title [URL3]\",\n ...\n ]\n \"date\": \"YYYY-MM-DD\",\n },\n {\n \"headlines\": [\n \"Headline 1 Title [URL1]\",\n \"Headline 2 Title [URL2]\",\n ...\n ]\n \"date\": \"YYYY-MM-DD\",\n },\n ...\n]\n```\n\n**Output Format In Markdown**\n\n```\n# HN Lookback <FullMonthName-DD> | <start YYYY> to <end YYYY> \n\n## [Theme 1]\n- YYYY [Headline 1](URL1)\n- YYYY [Headline 2](URL2)\n...\n\n## [Theme 2]\n- YYYY [Headline 1](URL1)\n- YYYY [Headline 2](URL2)\n...\n\n... \n\n## <this is optional>\n<if any interesing ternds emerge mention them in oneline>\n```\n\n**Here is the Json data for Hackernews Headlines across the years**\n\n```\n{{ JSON.stringify($json.data) }}\n```", "promptType": "define"}, "typeVersion": 1.5}, {"id": "b5a97c2a-0c3b-4ebe-aec5-7bca6b55ad4c", "name": "Google Gemini Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini", "position": [1740, -200], "parameters": {"options": {}, "modelName": "models/gemini-1.5-pro"}, "credentials": {"googlePalmApi": {"id": "", "name": "[Your googlePalmApi]"}}, "typeVersion": 1}, {"id": "18cba750-aef5-451d-880f-2c12d8540d78", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [-380, -360], "parameters": {"rule": {"interval": [{"triggerAtHour": 21}]}}, "typeVersion": 1.2}, {"id": "341da616-8670-4cd9-b47a-ee25e2ae9862", "name": "CreateYearsList", "type": "n8n-nodes-base.code", "position": [-200, -360], "parameters": {"jsCode": "for (const item of $input.all()) {\n const currentDateStr = item.json.timestamp.split('T')[0];\n const currentDate = new Date(currentDateStr);\n const currentYear = currentDate.getFullYear();\n const currentMonth = currentDate.getMonth(); // 0 for January, 1 for February, etc.\n const currentDay = currentDate.getDate();\n\n const datesToFetch = [];\n for (let year = currentYear; year >= 2007; year--) {\n let targetDate;\n if (year === 2007) {\n // Special handling for 2007 to start from Feb 19\n if (currentMonth > 1 || (currentMonth === 1 && currentDay >= 19))\n {\n targetDate = new Date(2007, 1, 19); // Feb 19, 2007\n } else {\n continue; // Skip 2007 if currentDate is before Feb 19\n }\n } else {\n targetDate = new Date(year, currentMonth, currentDay);\n }\n \n // Format the date as YYYY-MM-DD\n const formattedDate = targetDate.toISOString().split('T')[0];\n datesToFetch.push(formattedDate);\n }\n item.json.datesToFetch = datesToFetch;\n}\n\nreturn $input.all();"}, "typeVersion": 2}, {"id": "42e24547-be24-4f29-8ce8-c0df7d47a6ff", "name": "CleanUpYearList", "type": "n8n-nodes-base.set", "position": [0, -360], "parameters": {"options": {}, "assignments": {"assignments": [{"id": "b269dc0d-21e1-4124-8f3a-2c7bfa4add5c", "name": "datesToFetch", "type": "array", "value": "={{ $json.datesToFetch }}"}]}}, "typeVersion": 3.4}, {"id": "6e51ad05-0f3d-4bfb-8c8d-5b71e7355344", "name": "SplitOutYearList", "type": "n8n-nodes-base.splitOut", "position": [200, -360], "parameters": {"options": {}, "fieldToSplitOut": "datesToFetch"}, "typeVersion": 1}, {"id": "6f827071-718f-4e27-9f7a-cc50296f7bc4", "name": "GetFrontPage", "type": "n8n-nodes-base.httpRequest", "position": [420, -360], "parameters": {"url": "=https://news.ycombinator.com/front", "options": {"batching": {"batch": {"batchSize": 1, "batchInterval": 3000}}}, "sendQuery": true, "queryParameters": {"parameters": [{"name": "day", "value": "={{ $json.datesToFetch }}"}]}}, "typeVersion": 4.2}, {"id": "7287e6b1-337f-4634-ac23-5ceaa87b0db3", "name": "ExtractDetails", "type": "n8n-nodes-base.html", "position": [640, -360], "parameters": {"options": {}, "operation": "extractHtmlContent", "extractionValues": {"values": [{"key": "=headlines", "cssSelector": ".titleline", "returnArray": true, "skipSelectors": "span"}, {"key": "date", "cssSelector": ".pagetop > font"}]}}, "typeVersion": 1.2}, {"id": "fceff31e-4dcd-4199-89c5-8eb75cd479bf", "name": "GetHeadlines", "type": "n8n-nodes-base.set", "position": [920, -460], "parameters": {"options": {}, "assignments": {"assignments": [{"id": "e1ce33e9-e4f8-4215-bbdb-156a955a0a97", "name": "headlines", "type": "array", "value": "={{ $json.headlines }}"}]}}, "typeVersion": 3.4}, {"id": "f7683614-7225-4f05-ba12-86b326fdb4a1", "name": "GetDate", "type": "n8n-nodes-base.set", "position": [920, -280], "parameters": {"options": {}, "assignments": {"assignments": [{"id": "fc1d15f6-a999-4d6b-a7bc-3ffa9427679e", "name": "date", "type": "string", "value": "={{ $json.date }}"}]}}, "typeVersion": 3.4}, {"id": "7e09ce85-ece1-46a0-aa59-8e3da66413b2", "name": "MergeHeadlinesDate", "type": "n8n-nodes-base.merge", "position": [1180, -360], "parameters": {"mode": "combine", "options": {}, "combineBy": "combineByPosition"}, "typeVersion": 3}, {"id": "db3bf408-8179-4ca4-a5b4-8a390b68f994", "name": "SingleJson", "type": "n8n-nodes-base.aggregate", "position": [1380, -360], "parameters": {"options": {}, "aggregate": "aggregateAllItemData"}, "typeVersion": 1}, {"id": "2abbc0e9-ed1e-4ba0-9d2f-7c3cd314a0fe", "name": "Telegram", "type": "n8n-nodes-base.telegram", "position": [2020, -360], "parameters": {"text": "={{ $json.text }}", "chatId": "@OnThisDayHN", "additionalFields": {"parse_mode": "Markdown", "appendAttribution": false}}, "credentials": {"telegramApi": {"id": "", "name": "[Your telegramApi]"}}, "typeVersion": 1.2}], "pinData": {}, "connections": {"GetDate": {"main": [[{"node": "MergeHeadlinesDate", "type": "main", "index": 1}]]}, "SingleJson": {"main": [[{"node": "Basic LLM Chain", "type": "main", "index": 0}]]}, "GetFrontPage": {"main": [[{"node": "ExtractDetails", "type": "main", "index": 0}]]}, "GetHeadlines": {"main": [[{"node": "MergeHeadlinesDate", "type": "main", "index": 0}]]}, "ExtractDetails": {"main": [[{"node": "GetHeadlines", "type": "main", "index": 0}, {"node": "GetDate", "type": "main", "index": 0}]]}, "Basic LLM Chain": {"main": [[{"node": "Telegram", "type": "main", "index": 0}]]}, "CleanUpYearList": {"main": [[{"node": "SplitOutYearList", "type": "main", "index": 0}]]}, "CreateYearsList": {"main": [[{"node": "CleanUpYearList", "type": "main", "index": 0}]]}, "Schedule Trigger": {"main": [[{"node": "CreateYearsList", "type": "main", "index": 0}]]}, "SplitOutYearList": {"main": [[{"node": "GetFrontPage", "type": "main", "index": 0}]]}, "MergeHeadlinesDate": {"main": [[{"node": "SingleJson", "type": "main", "index": 0}]]}, "Google Gemini Chat Model": {"ai_languageModel": [[{"node": "Basic LLM Chain", "type": "ai_languageModel", "index": 0}]]}}}

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

Visualize your SQL Agent queries with OpenAI and Quickchart.io

Visualize your SQL Agent queries with OpenAI and Quickchart.io empowers you to instantly transform complex SQL Agent query results into insightful charts and graphs, all through a simple chat interface. This workflow connects an OpenAI Chat Model to interpret your chat messages, determine if a chart is needed using a Text Classifier, and then leverages Quickchart.io by generating a chart definition with structured output via an HTTP Request node. It automates the entire process from receiving a chat message to extracting the user's question, passing it to an AI Agent, and then conditionally generating and displaying a chart, saving significant time and effort for data analysts, developers, and business intelligence professionals who frequently need to visualize their SQL data. By automating chart generation, this workflow eliminates the manual steps of data extraction, chart selection, and configuration, allowing users to quickly gain visual insights from their SQL Agent queries without needing to switch between multiple tools or possess advanced charting skills.

19 nodes

Integrating AI with Open-Meteo API for Enhanced Weather Forecasting

Enhance your weather forecasting capabilities by integrating artificial intelligence with real-time meteorological data. This workflow automates the process of generating detailed weather forecasts based on user queries, leveraging the power of OpenAI to interpret requests and the Open-Meteo API to retrieve accurate weather information. It connects a chat interface, triggered by a "When chat message received" node, directly to a Generic AI Tool Agent. This agent then intelligently utilizes two custom tools: one to convert a city name into geographical coordinates via an HTTP request, and another to fetch the weather forecast from Open-Meteo using those coordinates, all while maintaining conversational context with the Chat Memory Buffer. This setup is ideal for developers building intelligent assistants, businesses needing dynamic weather insights for logistics or event planning, or anyone requiring an AI-driven, conversational interface for weather information, solving the challenge of manually looking up forecasts and providing a more intuitive user experience. By automating the data retrieval and interpretation, this workflow significantly reduces the time and effort involved in accessing and understanding weather patterns, allowing for quicker decision-making and improved operational efficiency.

12 nodes

Qualify replies from Pipedrive persons with AI

Automate the qualification of inbound email replies from Pipedrive contacts using artificial intelligence. This workflow connects Gmail and OpenAI to your Pipedrive CRM, streamlining your lead nurturing process. When a new email arrives in either of your specified Gmail inboxes (Email box 1 or Email box 2), the workflow searches for the sender as a person in Pipedrive. It then retrieves their full person details and sends the email content to OpenAI for an AI-powered assessment of interest (Is interested?). Based on OpenAI's response, if the person is deemed interested, a new deal is automatically created in Pipedrive, ensuring hot leads are immediately acted upon. This is ideal for sales teams, marketers, and business development professionals who receive a high volume of email replies and need to quickly identify and prioritize genuinely interested prospects, saving significant manual review time and accelerating sales cycles.

11 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.