A super basic http tool that makes only GET
request to given URL and returns
status code of the response. Well, if you are curl
or http
(httpie) user,
you can make the same kind of request and get a kind-of same response since
statoo
is way better simple :)
statoo
injects Accept-Encoding: gzip
request header to every http request!
$ go get -u github.com/vigo/statoo
$ statoo -h
usage: statoo [-flags] URL
flags:
-version display version information (X.X.X)
-t, -timeout default timeout in seconds (default: 10)
-h, -help display help
-json provides json output
-verbose verbose output (default: false)
-header request header, multiple allowed
-find find text in repsonse body if -json is set
examples:
$ statoo "https://ugur.ozyilmazel.com"
$ statoo -timeout 30 "https://ugur.ozyilmazel.com"
$ statoo -verbose "https://ugur.ozyilmazel.com"
$ statoo -json https://vigo.io
$ statoo -header "Authorization: Bearer TOKEN" https://vigo.io
$ statoo -header "Authorization: Bearer TOKEN" -header "X-Api-Key: APIKEY" https://vigo.io
$ statoo -json -find "Meetup organization" https://vigo.io
Let’s try:
$ statoo "https://ugur.ozyilmazel.com"
200
$ statoo -verbose "https://ugur.ozyilmazel.com"
https://ugur.ozyilmazel.com -> 200
or;
$ statoo -json https://vigo.io
response;
{
"url": "https://vigo.io",
"status": 200,
"checked_at": "2021-05-10T16:44:19.22862Z",
"response_duration": 231.701225,
"response_size": 1453
}
response_duration
is in milliseconds.response_size
is in bytes (gzipped)
Let’s find text inside of the response body. This feature is only available
if the -json
flag is set!
$ statoo -json -find "Meetup organization" https://vigo.io
{
"url": "https://vigo.io",
"status": 200,
"checked_at": "2021-05-10T16:45:35.980107Z",
"response_duration": 154.040385,
"response_size": 1453,
"find": "Meetup organization",
"found": true
}
$ statoo -json -find "meetup organization" https://vigo.io # case sensitive
{
"url": "https://vigo.io",
"status": 200,
"checked_at": "2021-05-10T16:46:03.04418Z",
"response_duration": 133.755459,
"response_size": 1453,
"find": "meetup organization",
"found": false
}
Now you can pass multiple -header
flags:
$ statoo -header "Key1: Value1" -header "Key2: Value2" "https://ugur.ozyilmazel.com"
It’s better to pipe -json
output to jq
or python -m json.tool
for pretty print :)
That’s it!
$ rake -T
rake default # show avaliable tasks (default task)
rake docker:build # Build
rake docker:rmi # Delete image
rake docker:run # Run
rake release[revision] # Release new version major,minor,patch, default: patch
rake test[verbose] # run tests
build:
$ docker build . -t statoo
run:
$ docker run -i -t statoo:latest statoo -h
$ docker run -i -t statoo:latest statoo -json -find "Meetup organization" https://vigo.io
- Uğur "vigo" Özyılmazel - Creator, maintainer
All PR’s are welcome!
fork
(https://github.com/vigo/statoo/fork)- Create your
branch
(git checkout -b my-feature
) commit
yours (git commit -am 'add some functionality'
)push
yourbranch
(git push origin my-feature
)- Than create a new Pull Request!
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
This project is licensed under MIT