npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wheregoes-cli

v1.0.1

Published

CLI tool to trace URL redirects

Downloads

7

Readme

WhereGoes CLI

npm version license

A command-line tool to trace the redirects of a given URL. Useful for uncovering the final destination of shortened, marketing, or affiliate links, especially when they are blocked by ad blockers like Pi-hole or AdGuard.


Table of Contents


Overview

When browsing the internet, you often encounter shortened URLs or links that redirect through multiple hops before reaching the final destination. These can be marketing, tracking, or affiliate URLs. Sometimes, ad blockers like Pi-hole or AdGuard may block these intermediary steps, preventing you from accessing the content.

WhereGoes CLI helps you trace all the redirects of a URL, revealing each hop along the way. This allows you to identify and access the final destination URL directly, bypassing any blocked intermediary steps.


Features

  • Trace Multiple Redirects: Uncover all the steps a URL takes to reach its final destination.
  • Bypass Blocked Links: Identify the end URL even if intermediary links are blocked by ad blockers.
  • Simple and Fast: Run a single command to get all the information you need.
  • Cross-Platform: Works on any system with Node.js installed.
  • Open Source: Source code is available for review and contribution.

Installation

You can use WhereGoes CLI directly with npx or install it globally via npm.

Using npx (No Installation Required)

npx wheregoes-cli <url>

Installing Globally with npm

npm install -g wheregoes-cli

Usage

Basic Syntax

wheregoes <url>

Basic Usage

After installing, you can use the wheregoes command followed by the URL you want to trace.

wheregoes https://short.url/example

Examples

Example 1: Tracing a Shortened URL

wheregoes http://bit.ly/2VvV4nM

Sample Output:

Trace Results for: http://bit.ly/2VvV4nM
Date Traced: Wed, 11 Oct 2023 12:00:00 GMT

Trace Steps:

Step 1:
URL      : http://bit.ly/2VvV4nM
Status   : 301
Location : https://tinyurl.com/yc3c3a9d

Step 2:
URL      : https://tinyurl.com/yc3c3a9d
Status   : 301
Location : https://www.example.com

Step 3:
URL      : https://www.example.com
Status   : 200
Location : N/A

Example 2: Uncovering the Destination of an Affiliate Link

wheregoes https://www.mydealz.de/visit/dealshot/2438758

Sample Output:

Trace Results for: https://www.mydealz.de/visit/dealshot/2438758
Date Traced: Wed, 11 Oct 2023 12:05:00 GMT

Trace Steps:

Step 1:
URL      : https://www.mydealz.de/visit/dealshot/2438758
Status   : 302
Location : https://mydealz.digidip.net/visit?url=https%3A%2F%2Fwww.tiktok.com%2F%40user%2Fvideo%2F123456789&ppref=https%3A%2F%2Fwww.mydealz.de&ref=2030072938

Step 2:
URL      : https://mydealz.digidip.net/visit?url=https%3A%2F%2Fwww.tiktok.com%2F%40user%2Fvideo%2F123456789&ppref=https%3A%2F%2Fwww.mydealz.de&ref=2030072938
Status   : 302
Location : https://www.tiktok.com/@user/video/123456789

Step 3:
URL      : https://www.tiktok.com/@user/video/123456789
Status   : 200
Location : N/A

Use Cases

  • Bypassing Blocked Links: If you use ad blockers like Pi-hole or AdGuard, some affiliate or tracking links might be blocked. Use WhereGoes CLI to find the final destination URL and access it directly.
  • Investigating URLs: Before clicking on an unfamiliar or suspicious link, trace it to see where it leads.
  • Web Development and Testing: Developers can use this tool to debug redirect issues in web applications.

How It Works

WhereGoes CLI sends a request to a Cloudflare Worker service that manually follows redirects without automatically following them, capturing each redirect step along the way.

The steps include:

  1. Initial Request: The tool sends a request to the provided URL.
  2. Redirect Handling: If the response indicates a redirect (HTTP status codes 3xx), it captures the Location header.
  3. Next Hop: The tool then sends a request to the URL specified in the Location header.
  4. Repeat: Steps 2 and 3 are repeated until a non-redirect response is received or a maximum number of hops is reached.
  5. Result Compilation: All the steps are compiled and displayed in an easy-to-read format.

Dependencies

  • Node.js: Make sure you have Node.js installed (version 12 or higher recommended).
  • npm: Comes bundled with Node.js.

Contributing

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the Repository: Click on the 'Fork' button at the top right of the repository page.

  2. Clone Your Fork: Clone your forked repository to your local machine.

    git clone https://github.com/yourusername/wheregoes-cli.git
  3. Install Dependencies:

    npm install
  4. Make Your Changes: Implement your feature or bug fix.

  5. Build the Project:

    npm run build
  6. Test Your Changes: Ensure everything works as expected.

  7. Commit and Push:

    git add .
    git commit -m "Description of your changes"
    git push origin your-branch-name
  8. Create a Pull Request: Go to the original repository and create a pull request from your fork.


License

This project is licensed under the MIT License - see the LICENSE file for details.


Disclaimer: Use this tool responsibly. Respect the terms of service of websites you are querying. The author is not responsible for how you use this tool.


Contact

If you have any questions or suggestions, feel free to open an issue or contact me at [email protected].


Happy Tracing!