-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
158 lines (148 loc) · 5.17 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
meow
An easy tool for making requests using cURL and following redirects
Usage:
meow [options...] <method> <URL>
meow [options...] <URL>
When the request can have a body (methods POST, PUT, DELETE, PATCH), then it is read from stdin.
When a successful response has a body, then it is written to stdout.
If the response cannot has a body (methods HEAD, PUT, TRACE), then its headers is written to stdout.
If cURL returns a non-zero exit code, its output is written to stderr without changes.
Methods can be specified in any case (post, POST, POsT, etc).
Allowed methods:
get (defalut)
head
post
put
delete
connect
options
trace
patch
Options:
-a, --useragent "<useragent>" - set a user-agent for the request
-c, --cookie "<cookie>" - set a cookie for the request (can be a filename)
-C, --save-cookie <filename> - save a cookie from the response to the file
-h, --header "<key>: <value>" - set a optional header for the request
-H, --head - get response head instead of body
-p, --proxy <proxy> - use the proxy
-r, --referrer <referrer> - set an address making the request
-t, --type <type> - set a MIME-type of the sending content
-v, --version - show a version of the tool
Install:
Just copy the meow.sh file to /usr/bin/meow
Example:
$ BASE=https://sode.su
$ meow get $BASE/@arelive/profile > test
$ cat test && echo # echo for newline
{"id":287228005,"username":"arelive","searchable":true,"friendable":"public","invitable":"protected","name":"Arelive","type":"user","cover":null,"avatar":"1313402292021605115.png","links":[]}
$ meow $BASE/@0/profile && echo # with redirect
{"id":0,"username":"anon","searchable":false,"friendable":"private","invitable":"private","name":"","type":"user","cover":null,"avatar":null,"links":[]}
$ meow post $BASE/api/me <<<'' && echo # unusable without auth
{"status":2}
$ COOKIE="lang=rus; userid=287228005 session=$SECRET_KEY" # auth
$ cat > data <<<'{"name": "Arelive, the creator of meow console utility"}'
$ meow post -c "$COOKIE" -t application/json $BASE/api/set.profile < data && echo
{"status":0}
# Now the name of profile changed
$ meow -H head $BASE/undefined # trying to get headers from unresolvable path
HTTP/2 404
server: Desu
date: Thu, 30 Sep 2021 10:11:08 GMT
content-type: text/html; charset=utf-8
content-length: 3253
content-security-policy: default-src 'self' oauth.telegram.org;style-src 'self';script-src 'self' 'unsafe-eval' telegram.org;base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src-attr 'none';upgrade-insecure-requests
x-dns-prefetch-control: off
expect-ct: max-age=0
x-frame-options: SAMEORIGIN
strict-transport-security: max-age=15552000; includeSubDomains
x-download-options: noopen
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: no-referrer
x-xss-protection: 0
cache-control: public, max-age: 0
etag: W/"cb5-iFGpwk3mDfL0gTfn+GMUM6pwYDg"
vary: Accept-Encoding
Shortcuts:
Some invalid mime values of the type specified with the -t flag
are automatically converted to valid shorthand commands.
If the conversion fails, they remain as they are.
cmd -> 'text/cmd'
css -> 'text/css'
csv -> 'text/csv'
html -> 'text/html'
javascript -> 'text/javascript'
text -> 'text/plain'
php -> 'text/php'
markdown -> 'text/markdown'
cache-manifest -> 'text/cache-manifest'
atom -> 'application/atom+xml'
EDI-X12 -> 'application/EDI-X12'
EDIFACT -> 'application/EDIFACT'
json -> 'application/json'
octet-stream -> 'application/octet-stream'
pdf -> 'application/pdf'
postscript -> 'application/postscript'
ps -> 'application/postscript'
soap -> 'application/soap+xml'
woff -> 'application/font-woff'
xhtml -> 'application/xhtml+xml'
dtd -> 'application/xml-dtd'
xop -> 'application/xop+xml'
bittorrent -> 'application/x-bittorrent'
tex -> 'application/x-tex'
xml -> 'application/xml'
acc -> 'audio/acc'
mp3 -> 'audio/mpeg'
vorbis -> 'audio/vorbis'
gif -> 'image/gif'
jpeg -> 'image/jpeg'
pjpeg -> 'image/pjpeg'
png -> 'image/png'
svg -> 'image/svg+xml'
tiff -> 'image/tiff'
webp -> 'image/webp'
iges -> 'model/iges'
mesh -> 'model/mesh'
vrml -> 'model/vrml'
form-data -> 'multipart/form-data'
quicktime -> 'video/quicktime'
webm -> 'video/webm'
.css -> 'text/css'
.csv -> 'text/csv'
.html -> 'text/html'
.htm -> 'text/html'
.js -> 'text/javascript'
.text -> 'text/plain'
.txt -> 'text/plain'
.php -> 'text/php'
.md -> 'text/markdown'
.json -> 'application/json'
.pdf -> 'application/pdf'
.ps -> 'application/postscript'
.woff -> 'application/font-woff'
.xhtml -> 'application/xhtml+xml'
.dtd -> 'application/xml-dtd'
.zip -> 'application/zip'
.gzip -> 'application/gzip'
.tex -> 'application/x-tex'
.xml -> 'application/xml'
.acc -> 'audio/acc'
.mp3 -> 'audio/mpeg'
.ogg -> 'audio/vorbis'
.gif -> 'image/gif'
.jpeg -> 'image/jpeg'
.jpg -> 'image/jpeg'
.pjpeg -> 'image/pjpeg'
.pjpg -> 'image/pjpeg'
.png -> 'image/png'
.svg -> 'image/svg+xml'
.tiff -> 'image/tiff'
.tif -> 'image/tiff'
.webp -> 'image/webp'
.iges -> 'model/iges'
.igs -> 'model/iges'
.mesh -> 'model/mesh'
.mp4 -> 'video/mp4'
.qtff -> 'video/quicktime'
.webm -> 'video/webm'