forked from grakshith/fterm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepl.sh
executable file
·75 lines (71 loc) · 1.51 KB
/
repl.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
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/bash
source config.cfg
curl -s -X GET \
"https://graph.facebook.com/v2.1/me/?access_token=$access_token" > init.data &
pid=$!
./wait.sh $pid
unset pid
error="$(jq -r ".error.message" init.data)"
#error="null"
usage() {
cat<<EOF
List of commands available
about Display the user's profile
home Display the user's home feed
timeline Display the user's timeline feeds
photos Display the user's photos
videos Display the user's videos
inbox Display the user's inbox
notifications Display the notifications
post message Post a message on your wall
post photo Post a photo on your wall
Navigation:
back To go back to the previous level
exit Quit the application
EOF
}
if [ "$error" != "null" ]; then
echo $error
exit 127
else
echo "Successfully authenticated"
echo "Start your terminal facebook journey!"
fi
while(true)
do
echo -n "% "
read input
if [ "$input" == "exit" ]; then
exit 0
fi
if [ "$input" == "home" ]; then
./stream.sh
fi
if [ "$input" == "timeline" ]; then
./home.sh
fi
if [ "$input" == "photos" ]; then
./display.sh
fi
if [ "$input" == "videos" ]; then
./vplay.sh
fi
if [ "$input" == "help" ]; then
usage
fi
if [ "$input" == "notifications" ]; then
./notify.sh
fi
if [ "$input" == "about" ]; then
./about.sh
fi
if [ "$input" == "inbox" ]; then
./inbox.sh
fi
if [ "$input" == "post message" ]; then
./postMessage.sh
fi
if [ "$input" == "post photo" ]; then
./postPhoto.sh
fi
done