An open API service indexing awesome lists of open source software.

https://github.com/phiilu/redirect-checker

The Redirect Checker is a cli that allows to generate an nginx map from csvs/xlsx & checks the validity of the redirect - according to the input.
https://github.com/phiilu/redirect-checker

Last synced: 5 months ago
JSON representation

The Redirect Checker is a cli that allows to generate an nginx map from csvs/xlsx & checks the validity of the redirect - according to the input.

Awesome Lists containing this project

README

          

# Redirect Checker

The Redirect Checker is a cli that allows to generate an nginx map from csvs/xlsx & checks the validity of the redirect - according to the input.

## Installation

`yarn`

## Usage

To get an overview of all available options run

```bash
./redirect-checker --help
```

**Output:**
```
Usage: redirect-checker [options]

Options:
--url Base URL entries will be tested against.
--source Relative path to csv or xlsx file (default: "./input/redirects.xlsx")
--sheets Exclude only certain sheets by name, comma separated. e.g: jahresreport,halb jahres report
--googleSheetsId Google Sheet Id - eg. https://docs.google.com/spreadsheets/d/
--debug enables additional output
--to-nginx creates an an redirects.map & redirects.txt nginx file
-h, --help display help for command
```

Run basic check
```bash
./redirect-checker --url "https://wienenergie.at"
```

# Source

## Document Structure

| old | new | comment | exclude | testonly | regexEnabled |
| ------------------------------- | ----------------------------- | --------------------------------- | ------- | -------- | ------------ |
| /tarifkampangne | /tarifkampagne | Fixes Typo | | | |
| ^/blog/energie | /blog/wien$1 | Fix for blog | | | x |
| /blog/energie/going-live | /blog/energie/wien/going-live | test for blog case | | x | |
| /imnotsureifineedtoberedirected | /imprettysurethough | Disabled - because we're not sure | x | | |

## Available Sources

### File Based
* csv
* xlsx

### Cloud Based

**Google Sheets**

Usage:
1. Add your credentials.json to /drivers/credentials.json
(https://developers.google.com/sheets/api/quickstart/nodejs)
2. run the `redirect-checker` with the `--googleSheetsId "ID-HERE"` option
3. You're all set. The script now uses the google sheet as the source

> Please be aware the the file has to be a "real" google sheet (you can spot an invalid "xlsx" sheet by the green "xlsx" next to the sheet title)