-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdex-sample.py
More file actions
63 lines (43 loc) · 1.23 KB
/
dex-sample.py
File metadata and controls
63 lines (43 loc) · 1.23 KB
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
"""
Keys and passwords for the Opinion Meter and Mailchimp
Called dex for rolodex auth is used and 'password-file.txt' is silly
this in an example with fake keys for GitHub sake
"""
import mailchimp
omUser = 'userlogin'
omPass = 'passwordd'
mailchimpList = 'xxxxxxxxxx'
# Edit the merge tags for all Mailchimp additions here:
def mailchimp_merge_tags():
return {
'METER' : 'Opinion Meter'
}
# Edit the location merge tag for Mailchimp additions here:
def GET_Mailchimp_Location_Tag():
return "LOC"
# surveryID : Name to go into above location Merge Tag
Mailchimp_Location_Ids = {
00010 : "Baltimore",
00004 : "Baltimore",
48654 : "Gatlinburg",
54458 : "Gatlinburg",
78954 : "BION",
13248 : "Orlando",
96345 : "Orlando"
}
#other vars to look for AND how to look for it
# <Mailchimp Merge Tag> : {strings, to, find, it}
#case insensitive
def getMailchimpOtherMergeVars():
return {
'ZIPPOSTAL': ['zip', 'zipcode', 'postal'],
}
def get_mailchimp_api():
return mailchimp.Mailchimp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us1')
def getLocationName(id):
try:
name = Mailchimp_Location_Ids[id]
return name
except:
name = ""
return ""