This repository has been archived by the owner on Feb 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-gtalk.sh
executable file
·127 lines (110 loc) · 2.53 KB
/
update-gtalk.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
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
#!/bin/sh
#wget https://graph.facebook.com/me/friends?access_token=...
#indent -bap friends ; grep -Pe '^"name' friends | tr -d '}' | sed 's/"name":"//g' | grep -Poe '^[a-z A-Z]+' > names
cat gmailfriends | zenity --list --column="NAMES"
smile=""
laugh=""
sad=""
cry=""
surprise=""
tongue=""
wink=""
default=""
picture="/home/kln/.mcabber/pictures/gmail/"
while true;
do
ans=$(zenity --list\
--title="Select Pictures"\
--column="Faces" --editable --column="Path"\
"Smile :)" "$smile"\
"Laugh :D" "$laugh"\
"Sad :(" "$sad"\
"Crying :'(" "$cry"\
"Surprise :O" "$surprise"\
"Tongue out :P" "$tongue"\
"Wink ;)" "$wink");
if [ "$ans" == "" ]
then
# id=$(cat friends | grep -Pe "$name" | cut -d '"' -f8);
# wget https://graph.facebook.com/$id/picture
ENTRY=`zenity --password --username`
case $? in
0)
id=$(echo $ENTRY | cut -d'|' -f1)
echo $id
passwd=$(echo $ENTRY | cut -d'|' -f2)
;;
1)
echo "Stop login."
exit;;
-1)
echo "An unexpected error has occurred."
exit;;
esac
key=$(curl https://www.google.com/accounts/ClientLogin -d Email=$id -d Passwd=$pass -d accountType=GOOGLE -d service=cp -k | tail -n1 | cut -d "=" -f2)
url=$(egrep -B 1 "$id" contacts | head -n1 | cut -d '"' -f2);
echo "qwerty $url"
mkdir -p $picture$id
curl --header "Authorization: GoogleLogin auth=$key" "$url" -k > ~/picture;
if [ "$smile" == "" ]
then
cp $picture$id/picture $picture$id/OikK
else
cp $smile $picture$id/OikK
fi
if [ "$laugh" == "" ]
then
cp $picture$id/picture $picture$id/OkQK
else
cp $laugh $picture$id/OkQK
fi
if [ "$sad" == "" ]
then
cp $picture$id/picture $picture$id/OigK
else
cp $sad $picture$id/OigK
fi
if [ "$cry" == "" ]
then
cp $picture$id/picture $picture$id/OicoCg==
else
cp $cry $picture$id/OicoCg==
fi
if [ "$surprise" == "" ]
then
cp $picture$id/picture $picture$id/Ok8K
else
cp $surprise $picture$id/Ok8K
fi
if [ "$tongue" == "" ]
then
cp $picture$id/picture $picture$id/OlAK
else
cp $tongue $picture$id/OlAK
fi
if [ "$wink" == "" ]
then
cp $picture$id/picture $picture$id/OykK
else
cp $wink $picture$id/OykK
fi
break;
fi
file=$(zenity --file-selection --title="Select a File");
case $ans in
"Smile :)")
smile=$file;;
"Laugh :D")
laugh=$file;;
"Sad :(")
sad=$file;;
"Crying :'(")
cry=$file;;
"Surprise :O")
surprise=$file;;
"Tongue out :P")
tongue=$file;;
"Wink ;)")
wink=$file;;
esac
done;