Skip to content

Commit cbaa47f

Browse files
miaggdehesa
authored andcommitted
Add get-ttfb command
1 parent 4973d12 commit cbaa47f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Required parameters:
4+
# @raycast.schemaVersion 1
5+
# @raycast.title Get TTFB (Time to First Byte)
6+
# @raycast.mode fullOutput
7+
8+
# Optional parameters:
9+
# @raycast.icon 🕐
10+
# @raycast.packageName Developer Utils
11+
12+
# Documentation:
13+
# @raycast.description Get the TTFB (Time to First Byte) of a website
14+
# @raycast.author Angelos Michalopoulos
15+
# @raycast.authorURL https://github.com/miagg
16+
# @raycast.argument1 { "type": "text", "placeholder": "domain" }
17+
18+
if [ -z "$1" ]; then
19+
echo "Please provide a domain"
20+
exit 1
21+
fi
22+
23+
curl -o /dev/null \
24+
-H 'Cache-Control: no-cache' \
25+
-s \
26+
-w "\nLookup time:\t\t\t%{time_namelookup}\nConnect time:\t\t%{time_connect}\nSSL handshake time:\t%{time_appconnect}\nPre-Transfer time:\t%{time_pretransfer}\nRedirect time:\t\t%{time_redirect}\nTime to first byte:\t%{time_starttransfer}\n\nTotal time:\t\t\t%{time_total}\n" \
27+
--fail \
28+
--silent \
29+
--show-error \
30+
"$1"

0 commit comments

Comments
 (0)