I Built NetPrune: A Rust Tool to Clean Up My 12,000+ LinkedIn Connections
Altug Tatlisu

Altug Tatlisu @chronocoders

About: Rust dev turning caffeine into code. Building blockchain by day, retro web apps by night. 🦀 Rust | ⚡ WebAssembly | 🎨 Retro Tech Currently: Making telegraph machines jealous.

Location:
New York
Joined:
Oct 26, 2025

I Built NetPrune: A Rust Tool to Clean Up My 12,000+ LinkedIn Connections

Publish Date: Nov 26 '25
0 6

How I used Rust to analyze and filter 12,613 LinkedIn connections, and what I learned about automation, ToS violations, and building developer tools

The Problem: 12,613 Connections and Counting

Let me tell you a story about accidentally collecting too many LinkedIn connections and deciding to do something about it.

I run a blockchain company, and over the years, I've been pretty liberal with LinkedIn connection requests. My thinking was simple: more connections equals more opportunities, right?

Wrong.

My feed became a mess. For every interesting blockchain developer or tech entrepreneur, I had 10 crypto scammers, NFT shillers, and completely unrelated professionals. Finding actual valuable content was like searching for a needle in a haystack.

I needed to clean house. But clicking through 7,000+ profiles manually? No thanks.

The Solution: Build It Myself

I'm a Rust developer, so naturally, my solution was to build a tool.

The plan was simple:

  1. Export my LinkedIn connections as CSV
  2. Filter them based on keywords (blockchain, Web3, Rust, and similar terms)
  3. Automatically remove the irrelevant ones

Spoiler alert: Step 3 didn't go as planned. But let's start from the beginning.

Building NetPrune

Part 1: The Analysis Tool (This Actually Worked)

The first part was straightforward. LinkedIn lets you export your connections as a CSV file. I wrote a Rust parser to read it:

pub fn parse_csv(path: &str) -> Result<Vec<Connection>> {
    let mut reader = csv::Reader::from_path(path)?;
    let mut connections = Vec::new();

    for result in reader.deserialize() {
        let connection: Connection = result?;
        connections.push(connection);
    }

    Ok(connections)
}
Enter fullscreen mode Exit fullscreen mode

Then I built a keyword-based filter. If someone's position or company contained terms like "blockchain," "crypto," or "Rust developer," they were marked as "relevant." Everyone else was "unwanted."

The Results:

  • Total connections: 12,613
  • Relevant connections (blockchain and tech): 5,101 (40.4%)
  • Unwanted connections: 7,512 (59.6%)
  • Ghost connections (deactivated accounts): 2,750

Holy crap. 60% of my network was noise.

Part 2: The Automation Attempt (This Did Not Work)

Here's where things got interesting. I thought I could use headless_chrome to automate the removals.

I spent hours:

  • Inspecting LinkedIn's DOM structure
  • Finding CSS selectors
  • Writing click automation code
  • Debugging why buttons wouldn't click
fn remove_single_connection(&self, tab: &Tab, profile_url: &str) -> Result<()> {
    tab.navigate_to(profile_url)?;

    // Click "More actions" button
    let more_button = tab.find_element("button[aria-label*='More actions']")?;
    more_button.click()?;

    // Click "Remove connection"
    let remove_button = tab.find_element("div[aria-label*='Remove connection']")?;
    remove_button.click()?;

    // Confirm removal
    let confirm_button = tab.find_element("button[data-test-dialog-primary-btn]")?;
    confirm_button.click()?;

    Ok(())
}
Enter fullscreen mode Exit fullscreen mode

It opened the browser. It navigated to profiles. But the actual removal? Didn't work.

LinkedIn's DOM is a nightmare:

  • Class names change constantly
  • Menu items don't exist in the DOM until clicked
  • Elements disappear when you lose focus
  • Everything is dynamically rendered with Ember.js

But here's the real problem...

The Wake-Up Call: Terms of Service

I showed my progress to Claude (yes, I use AI assistants for code review), and it hit me with a reality check:

"LinkedIn's User Agreement explicitly prohibits automated access and scraping. Section 8.2 and 8.3. You could get banned."

Oh.

I looked it up. Claude was right. Even if I got the automation working perfectly, I would be:

  • Violating LinkedIn's Terms of Service
  • Risking account suspension
  • Teaching others to do the same

Not cool.

The Pivot: Analysis Tool Only

So I made a decision: NetPrune would be an analysis and filtering tool, not an automation tool.

The automation code is still there for educational purposes, but with prominent warnings everywhere:

Warning: Browser automation violates LinkedIn Terms of Service
Use this tool for ANALYSIS ONLY. Remove connections manually.
Enter fullscreen mode Exit fullscreen mode

The recommended workflow became:

  1. Use NetPrune to analyze your connections
  2. Export the filtered CSV
  3. Use LinkedIn's official bulk selection features
  4. Remove connections manually (spread over days or weeks)

Is it slower? Yes. Is it legal and safe? Also yes.

What I Learned

Sometimes "Good Enough" Beats "Perfect"

My original plan was full automation. The final product is a CSV analysis tool with optional (but risky) automation. And you know what? The analysis part alone is incredibly valuable.

Read The Terms of Service

Seriously. I almost published a tool that could get users banned. Always check if what you're building violates platform policies.

Rust is Perfect for CLI Tools

Zero runtime dependencies, fast CSV parsing, great error handling with anyhow, and clap for CLI parsing made this project enjoyable to build.

Documentation Matters

I built:

  • A retro-punk styled landing page
  • GitHub Wiki with detailed guides
  • Comprehensive Rust documentation
  • Safety warnings everywhere

Good documentation turns a "cool hack" into a "useful tool."

The Final Product

NetPrune is now live:

Install it:

cargo install netprune
Enter fullscreen mode Exit fullscreen mode

Use it:

netprune analyze --input Connections.csv
netprune export --input Connections.csv --output unwanted.csv
Enter fullscreen mode Exit fullscreen mode

Should You Use It?

If you have thousands of LinkedIn connections and want to:

  • Analyze your network statistically
  • Filter by keywords or industries
  • Export lists for manual review

Then yes! NetPrune is safe, legal, and useful.

If you want to auto-remove 5,000 connections overnight? Please don't. LinkedIn will ban you, and I'll feel guilty.

What's Next?

I'm considering:

  • Better filtering algorithms (possibly ML-based scoring)
  • Web UI for easier connection review
  • Integration with other professional networks
  • Analytics dashboard

But for now, NetPrune does one thing well: helping you understand your network so you can make informed decisions about who to keep.


Have you ever had to clean up a massive social network? How did you approach it? Drop a comment below!

Post-script: Yes, I'm still manually removing those 7,000+ connections. It's tedious. Send help.


Links

Built with love and Rust by ChronoCoders

Comments 6 total

  • Elon Reeve Musk
    Elon Reeve MuskNov 27, 2025

    That’s great news.

  • Cyber Safety Zone
    Cyber Safety Zone Nov 27, 2025

    Cool project — nice work building NetPrune to clean up 12,000+ connections. (That’s no small feat.)

    I totally agree: having a leaner, more relevant network often beats having thousands of stale connections. It’s a reminder that sometimes “less is more” — and a simple tool can make a huge difference.

    Thanks for sharing your experience and code — this is the kind of practical, no-fluff work that gets real improvements done.

    • Altug Tatlisu
      Altug TatlisuNov 27, 2025

      Thanks so much for the kind words! Cleaning up 12,000+ connections was definitely a challenge, but it feels great to have a more focused network. Totally agree — sometimes less really is more, and even a small tool like NetPrune can make a big difference. Really appreciate you taking the time to check it out!

  • Ranjan Dailata
    Ranjan DailataNov 28, 2025

    Interesting.

    You could build a SaaS or an automation which could further do the end-to-end filtering and the management of connections via the 3rd parties so the low code/no platforms like n8n, make, gumploop can potentially utilize.

    • Altug Tatlisu
      Altug TatlisuNov 28, 2025

      Great insight, Ranjan! There's definitely potential there.
      The modular architecture could easily expose API endpoints for n8n/Make integrations - enabling workflows like auto-archiving inactive connections or syncing to CRMs.
      Main consideration would be LinkedIn's ToS and rate limiting for a public service. Keeping it open-source lets users run it locally with full control, but a managed solution with proper throttling could work too.
      What's your preference - managed service or self-hosted with better platform integrations?

      • Ranjan Dailata
        Ranjan DailataNov 29, 2025

        Like you said, I totally agree with you regarding the open-source solution. I consider the self-hosted options work great for the developers and small businesses who wish to run them on their own. However, I also see the benefits of managed services that could be potentially utilized by various organizations. Most of the SaaS services start small and then they see the potential and consider building the managed services is something I have experienced.

Add comment