-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·63 lines (53 loc) · 1.16 KB
/
test.sh
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
#!/bin/bash
href=https://twitter.com/SenWhitehouse/status/909818723028127749
hrid=909818723028127749
function test_created {
echo
echo '# test_created'
if twurl user get "https://api.twitter.com/2/tweets/${hrid}?tweet.fields=created_at" print
then
echo '#'
return 0
else
echo ng
return 1
fi
}
function test_embeded {
echo
echo '# test_embeded'
if reference=$(urlencode "${href}") &&
twurl user get "https://publish.twitter.com/oembed?url=${reference}&maxwidth=500&maxheight=500&omit_script=1" print
then
echo '#'
return 0
else
echo ng
return 1
fi
}
function test_together {
echo
echo '# test_together'
if reference=$(urlencode "${href}") &&
twurl user get "https://api.twitter.com/2/tweets/${hrid}?tweet.fields=created_at" user get "https://publish.twitter.com/oembed?url=${reference}&maxwidth=500&maxheight=500&omit_script=1" print
then
echo '#'
return 0
else
echo ng
return 1
fi
}
if ! test_created
then
exit 1
fi
if ! test_embeded
then
exit 1
fi
if ! test_together
then
exit 1
fi