Zach’s ugly mug (his face) Zach Leatherman

spider-pig Searches for Nodes that match a CSS Selector

January 18, 2018

spider-pig is a command line utility that takes a URL and retrieves all the local URL links on the page. It can also search for a CSS selector on each local URL to measure the impact of a CSS change.

Homer Simpson holding up a pig upside-down pretending that it’s walking on the ceiling

Get a list of local URL links from a root URL. Works with JavaScript generated content.

<a href="test.html">Test</a><!-- match -->
<a href="test2.html">Test</a><!-- match -->
<a href="test2.html">Duplicate Test</a><!-- do not match -->
<a href="root.html">URL to self</a><!-- match -->
<a href="mailto:test@example.com">Email link</a><!-- do not match -->
<a href="http://www.google.com/">External</a><!-- do not match -->

Can also act as a live-DOM CSS search across multiple files (find all the templates that are using the CSS selector I want to change). If I’m worried about changing code in a CSS selector, I’ll use this tool to search for instances of the selector across my project.

spider-pig on the command line

< Newer
Making a Simple Web Site with the Simplest Static Site Generator, Level 1
Older >
Airing Out 2017’s Dirty Laundry

Zach Leatherman IndieWeb Avatar for https://zachleat.com/is a builder for the web at IndieWeb Avatar for https://fontawesome.com/Font Awesome and the creator/maintainer of IndieWeb Avatar for https://www.11ty.devEleventy (11ty), an award-winning open source site generator. At one point he became entirely too fixated on web fonts. He has given 84 talks in nine different countries at events like Beyond Tellerrand, Smashing Conference, Jamstack Conf, CSSConf, and The White House. Formerly part of CloudCannon, Netlify, Filament Group, NEJS CONF, and NebraskaJS. Learn more about Zach »

8 Reposts

nrk 9819Giana ✨Nicolas HoizeyLewis DaleManuel Strehl ????James NashkatherineEric McCormick

49 Likes

Matt JacobsChrisAaron Hansnrk 9819Patrick FultonNick FChris ColemanCJ DunnGiana ✨danSimon Cox :SEO:如月飛羽????Angela "Ge" RicciJoshConor C. Peterson :kirby_fly:Gene ChuKrzysztof JeziornyNicolas HoizeyJoachimseawolffAlexManuel Strehl ????Lorenz KahlÓscar GarcíaScottAngel PonceRick GregorymaddesignsWil NicholslucianoEatonMatt SteinMelanie RichardsBen HollisStephen BellChase McCoyEric PortisNathan KnowlerTristan HarwardfLaMEdElly Loel ✨????Eric McCormickMike AparicioMichael GaleHowdy, I'm Jackwesruv 💻🐕Ethan MarcotteDavid PolitiHugo Tunius 🦀
8 Comments
  1. Todd Morey

    Kind of missed the point of the post because I was too busy flippin' css on and off on your site.

  2. Sameera

    spider pig!!

  3. Zach Leatherman

    bells and whistles: pick one!

  4. Zach Leatherman

    only spiderpig knows what spiderpig does 🏆

  5. fLaMEd

    @zachleat wow that’s super cool. Often wondered how to easily figure out what’s used where or not at all!

  6. CJ Dunn

    @zachleat thanks for posting this! Just yesterday I was wondering how to do something like this for my site

  7. nrk 9819

    @zachleat this is super cool. Wish I saw this earlier lol

  8. Zach Leatherman :verify:

    @cjtype I hope it’s useful!

Shamelessly plug your related post

These are webmentions via the IndieWeb and webmention.io.

Sharing on social media?

This is what will show up when you share this post on Social Media:

How did you do this? I automated my Open Graph images. (Peer behind the curtain at the test page)