jsonly is a command-line tool written in Go that filters URLs from input and only prints those that match the following criteria:
- The URL must be a valid HTTP/HTTPS URL.
- The URL must have a
.jsfile extension.
- Reads URLs from
stdin. - Filters only URLs that end with
.js. - Displays usage if no parameters or input are provided.
jsonly < input_fileThis command will read from the input_file, filter out any non-.js URLs, and print the matching ones to stdout.
Given the following input (input.txt):
http://example.com/script.js
http://example.com/index.html
https://example.com/other.js
https://example.com/script.jsRunning the tool like this:
cat input.txt | jsonlyWould output:
http://example.com/script.js
https://example.com/other.js
https://example.com/script.jsIf no input is provided (i.e., the program is run without a pipe or input_file), it will display the usage message and exit:
Usage: jsonly < input_file
Filters URLs that end with .js from stdin input.-
Clone the repository:
git clone https://github.com/0xsudomode/jsonly.git cd jsonly -
Build the binary:
go build -v jsonly.go
-
Run the binary:
./jsonly < input_fileOr pipe input directly to it:
linkfinder -o cli -i "http://example.com" | jsonly