wheregoes-cli
v1.0.1
Published
CLI tool to trace URL redirects
Downloads
7
Readme
WhereGoes CLI
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:
- Initial Request: The tool sends a request to the provided URL.
- Redirect Handling: If the response indicates a redirect (HTTP status codes 3xx), it captures the
Location
header. - Next Hop: The tool then sends a request to the URL specified in the
Location
header. - Repeat: Steps 2 and 3 are repeated until a non-redirect response is received or a maximum number of hops is reached.
- 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:
Fork the Repository: Click on the 'Fork' button at the top right of the repository page.
Clone Your Fork: Clone your forked repository to your local machine.
git clone https://github.com/yourusername/wheregoes-cli.git
Install Dependencies:
npm install
Make Your Changes: Implement your feature or bug fix.
Build the Project:
npm run build
Test Your Changes: Ensure everything works as expected.
Commit and Push:
git add . git commit -m "Description of your changes" git push origin your-branch-name
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!