Giter Site home page Giter Site logo

link-lister's Introduction

The Link Lister

The Link Lister is a Python utility that extracts links from nested pages within a specified subdirectory of a website. It takes a RSS feed URL as input, retrieves the URLs listed in the feed, and then processes each URL to find all the links within the specified subdirectory.

This is useful, for example, if you want to map internal linking between blog posts.

The script generates a matrix that represents the relationship between the processed URLs. The matrix is stored as a CSV file where each row and column corresponds to a URL, and an 'X' is placed in the matrix if a link exists between the URLs.

Prerequisites

  • Python 3.x
  • pip (Python package installer)

Installation

  1. Clone the repository:
git clone https://github.com/tb-peregrine/link-lister.git
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

python script.py <RSS.xml URL> <subdirectory> [OPTIONS]

Arguments:

  • <RSS.xml URL>: The URL of the RSS feed to retrieve the URLs from.
  • <subdirectory>: The subdirectory of the website to search for links within.

Options

  • -l, --limit: The maximum number of URLs to process from the RSS feed. Processes the first <limit> links.
  • -p, --parent_class: The class name of the parent element within which you want to search for links.

Example:

python script.py https://example.com/rss.xml /blog -limit 10 -parent_class article-container

The script will retrieve the first 10 URLs from the specified RSS feed, process each URL to find the links within the /blog subdirectory, and generate a matrix of the link relationships.

Output

The matrix will be saved as a CSV file named matrix.csv in the current directory.

License & Copyright

Copyright 2023 by Cameron Archer

Licensed under the Apache License, Version 2.0

link-lister's People

Contributors

tb-peregrine avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.