-
Notifications
You must be signed in to change notification settings - Fork 1
/
jsonFormat.py
98 lines (91 loc) · 2.27 KB
/
jsonFormat.py
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
'''------------------------------------------------------------------------------------------------------------------------------------------------------
# The NOW cards contents go here inside the payload dictionary
------------------------------------------------------------------------------------------------------------------------------------------------------'''
payload_anind = {"content": {
"genericCard": {
"title": {
"displayString": "Door Knocker"
},
"content": {
"displayString": "Successful NOW card"
},
"tapAction": {
"urls": [
"http://cmu.buildingdepot.org/knockerface.png"
]
},
"logo": {
"url": "http://cmu.buildingdepot.org/cmu1.png"
},
"buttons": [
{
"name": "CALL",
"icon": "call",
"tapAction": {
"urls": [
"android-app://com.example.deeplinkapp/callschema/myapp.com"
]
}
},
{
"name": "SMS",
"icon": "sms",
"tapAction": {
"urls": [
"android-app://com.example.deeplinkapp/textschema/myapp.com"
]
}
}
],
"image": {
"url": "http://cmu.buildingdepot.org/knockerface.png"
},
},
"locales": [
"en"
],
"justification": {
"displayString": "Issued to Andrew Dey since his door was knocked"
}
}
}
# payload_anind['content'] ['genericCard'] ['content'] ['displayString'] = "Hello"
# print payload_anind
# https://mail.google.com/mail/?view=cm&fs=1&tf=1&[email protected]&su=Hello
# "url": "http://s22.postimg.org/unc61tizl/KNOCKERIMAGE.jpg"
payload_knocker = {"content": {
"genericCard": {
"title": {
"displayString": "Door Knocker"
},
"content": {
"displayString": "<CARD CONTENT>"
},
"tapAction": {
"urls": [
"http://google.com/"
]
},
"logo": {
"url": "http://cmu.buildingdepot.org/cmu1.png"
},
"buttons": [
{
"name": "send an email",
"icon": "sms",
"tapAction": {
"urls": [
"android-app://com.example.deeplinkapp/mailschema/myapp.com"
]
}
}
],
},
"locales": [
"en"
],
"justification": {
"displayString": "Issued since you knocked Andrew's door"
}
}
}