Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ HNLINK

Turn Hacker News into LinkedIn Virality β€” On Autopilot

Discover trending Hacker News stories, transform them into engaging LinkedIn posts with AI, review them in Telegram, and publish with a single tap.

Python Telegram LinkedIn OpenRouter License HF Spaces

Features β€’ Workflow β€’ Getting Started β€’ Deployment β€’ FAQ

Stop writing LinkedIn posts manually. Let AI do the boring part. You just approve and publish.


HNLINK Demo

πŸ’‘ Why HNLINK?

Every day, Hacker News surfaces some of the best discussions in tech.

You read an article, think "I should post about this on LinkedIn," then spend the next 20 minutes:

  • Writing a hook
  • Rewriting paragraphs
  • Finding hashtags
  • Looking for an image
  • Editing the formatting
  • Wondering whether it's good enough

Eventually you either publish something average...

...or don't publish anything at all.

HNLINK automates everything except the final decision.

You stay in control while AI handles the repetitive work.


✨ Features

  • πŸ”₯ Fetch trending Hacker News stories
  • πŸ“– Extract complete article content
  • πŸ–Ό Automatically download the featured image
  • πŸ€– Generate high-quality LinkedIn posts with AI
  • πŸ“± Review posts inside Telegram
  • βœ… One-tap approval workflow
  • πŸ’Ό Publish directly to LinkedIn
  • 🚫 Prevent duplicate posts with SQLite history
  • ⚑ Powered by OpenRouter
  • 🐳 Docker ready
  • ☁️ Free deployment on Hugging Face Spaces

πŸš€ What Happens?

1. Fetch Hacker News
        β”‚
        β–Ό
2. Extract Article + Image
        β”‚
        β–Ό
3. AI Writes LinkedIn Post
        β”‚
        β–Ό
4. Send to Telegram
        β”‚
   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
   β”‚         β”‚
Approve    Skip
   β”‚         β”‚
   β–Ό         β–Ό
LinkedIn   Archive

βš™οΈ How It Works

flowchart LR

A[Hacker News API]
--> B[Article Extractor]

B --> C[Image Extractor]

C --> D[OpenRouter AI]

D --> E[Telegram Bot]

E -->|Approve| F[LinkedIn API]

E -->|Skip| G[Discard]
Loading

🧠 Why The AI Output Works

HNLINK isn't just summarizing articles.

It follows a repeatable structure designed for professional social media.

Every generated post includes:

  • 🎣 Attention-grabbing opening hook
  • πŸ“– Short readable paragraphs
  • 🧠 Key insights instead of article summaries
  • πŸ“ˆ Three-level hashtag strategy
  • πŸ’¬ Conversation-starting ending
  • 🚫 No Markdown
  • 🚫 No URLs
  • πŸ“Έ Original article image

The result is content that's ready to paste directly onto LinkedIn.


πŸ“Έ Example Output

Most developers are optimizing the wrong thing.

A Hacker News discussion today highlighted a startup that
reduced infrastructure costs by nearly 80%.

Not by switching cloud providers.

Not by adding more engineers.

They simply questioned one assumption everyone else accepted.

Sometimes the biggest improvements come from deleting,
not adding.

What's one engineering decision you've changed your mind about recently?

#SoftwareEngineering
#Programming
#Startups
#HackerNews

πŸ›  Tech Stack

Technology Purpose
Python Core application
OpenRouter AI generation
Telegram Bot API Review workflow
LinkedIn API Publishing
Hacker News API Story source
BeautifulSoup Article extraction
Requests Networking
SQLite History tracking
Docker Deployment

πŸš€ Getting Started

Requirements

  • Python 3.10+
  • OpenRouter API Key
  • LinkedIn Developer App
  • Telegram Bot
  • LinkedIn Access Token

Installation

git clone https://github.com/Lumacodes/HNLINK.git

cd HNLINK

python -m venv .venv

source .venv/bin/activate

pip install -r requirements.txt

Configuration

cp .env.example .env

Fill the environment variables.

OPENROUTER_API_KEY=sk-or-...

LINKEDIN_ACCESS_TOKEN=your_token

LINKEDIN_PERSON_URN=urn:li:person:xxxxxxxx

TELEGRAM_BOT_TOKEN=xxxxxxxx

TELEGRAM_CHAT_ID=xxxxxxxx

Environment Variables

Variable Required Description
OPENROUTER_API_KEY βœ… OpenRouter API key
LINKEDIN_ACCESS_TOKEN βœ… LinkedIn OAuth token
LINKEDIN_PERSON_URN βœ… LinkedIn profile URN
TELEGRAM_BOT_TOKEN βœ… Telegram Bot token
TELEGRAM_CHAT_ID βœ… Chat ID for approvals

Run

python src/telegram_bot.py

Open Telegram.

/fetch

Within a few seconds you'll receive generated posts with:

βœ… Approve

❌ Skip

Approve publishes immediately.

Skip permanently ignores the story.


πŸ“± Telegram Commands

Command Description
/start Display available commands
/fetch Generate 3 LinkedIn posts
/fetch 5 Generate 5 posts
/status Check APIs and bot health
/history View posting statistics
/help Show command reference

πŸ“‚ Project Structure

HNLINK/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ telegram_bot.py
β”‚   β”œβ”€β”€ hn_fetcher.py
β”‚   β”œβ”€β”€ content_extractor.py
β”‚   β”œβ”€β”€ post_generator.py
β”‚   β”œβ”€β”€ linkedin_poster.py
β”‚   └── history_tracker.py
β”‚
β”œβ”€β”€ config/
β”‚   └── settings.py
β”‚
β”œβ”€β”€ scripts/
β”‚   └── run_pipeline.py
β”‚
β”œβ”€β”€ assets/
β”‚   └── demo.gif
β”‚
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
└── README.md

☁️ Deployment

Hugging Face Spaces (Recommended)

  1. Fork this repository
  2. Create a Docker Space
  3. Add environment variables as Secrets
  4. Push your code

Your bot stays online 24/7 for free.


Docker

docker build -t hnlink .

docker run --env-file .env hnlink

🎯 Perfect For

  • Software Engineers
  • Indie Hackers
  • Startup Founders
  • DevRel Teams
  • Technical Writers
  • AI Content Creators
  • Open Source Maintainers

πŸ—Ί Roadmap

  • Reddit support
  • Product Hunt support
  • RSS feeds
  • Multi-language generation
  • Multiple LinkedIn accounts
  • Scheduled publishing
  • Analytics dashboard
  • Custom AI prompts
  • Team collaboration
  • Web dashboard

🀝 Contributing

Contributions are welcome.

If you have an idea, bug fix, or feature request:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a Pull Request

Every contribution is appreciated.


❓ FAQ

Is OpenRouter free?

Yes.

The free tier is enough for testing and light usage.


Does HNLINK publish automatically?

No.

Every generated post must be approved inside Telegram.


Can I use another AI model?

Yes.

Any model available through OpenRouter can be used.


Can I customize the prompt?

Absolutely.

Simply edit the prompt inside post_generator.py.


Does it repost the same article?

No.

Published stories are stored in SQLite to prevent duplicates.


πŸ“„ License

Released under the MIT License.

Use it for personal or commercial projects.


⭐ Support the Project

If HNLINK saves you time or helps you stay consistent on LinkedIn, consider giving the repository a star.

It helps more developers discover the project.

Built with β˜•, Python, and too much time spent reading Hacker News.

Made by Luma

About

HNLINK is an end-to-end content automation pipeline that monitors trending Hacker News stories, extracts article content and metadata, generates LinkedIn-ready posts with AI, and delivers them for approval before publishing.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages