This repository has been archived by the owner on Apr 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
config.js
160 lines (130 loc) · 4.24 KB
/
config.js
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
var city = 'Singapore';
var country = 'Singapore';
var locationSymbol = 'SG';
var db = require('./lib/database')
var logger = require('./lib/logger')
function objectToArray(obj) {
if (Array.isArray(obj)) {
return obj
}
var arr = []
for (var groupid in obj) {
if( obj.hasOwnProperty( groupid ) ) {
arr.push(obj[groupid])
}
}
return arr
}
module.exports = function(callback) {
db.once('value', function(snapshotAll) {
var snapshot = snapshotAll.val()
return callback({
originalDB: snapshot,
location: city,
city: city,
country: country,
symbol: locationSymbol,
api_version: 'v1',
apiUrl: 'https://webuild.sg/api/v1/',
displayTimeformat: 'DD MMM YYYY, ddd, h:mm a',
dateFormat: 'YYYY-MM-DD HH:mm Z',
timezone: '+0800',
timezoneInfo: 'Asia/Singapore',
debug: process.env.NODE_ENV === 'development',
calendarTitle: 'We Build SG Events',
podcastApiUrl: 'http://webuildsg.github.io/live/api/v1/podcasts.json',
domain: 'webuild.sg',
facebookGroups : objectToArray(snapshot.facebookGroups),
blacklistEvents: objectToArray(snapshot.blacklistEvents),
whitelistEvents: objectToArray(snapshot.whitelistEvents),
icsGroups: objectToArray(snapshot.icsGroups),
whitelistGroups: objectToArray(snapshot.whitelistGroups),
archives: {
githubRepoFolder: 'webuildsg/data/',
committer: {
name: 'We Build SG Bot',
email: '[email protected]'
}
},
ignoreWordsInDuplicateEvents: [
"meetup", "group", "event",
"centre", "center", "tower", "road", "boulevard", "ayer",
"avenue", "ave",
"building", "city",
"jalan", "jln",
"lane", "ln",
"street", "st",
"plaza", "town", "new",
"level", "floor",
"first",
"second",
"third",
"jan", "january",
"feb", "february",
"mar", "march",
"apr", "april",
"may",
"jun", "june",
"jul", "july",
"aug", "august",
"sep", "sept", "september",
"oct", "october",
"nov", "november",
"dec", "december",
"-",
"mon", "monday",
"tue", "tues", "tuesday",
"wed", "wednesday",
"thu", "thurs", "thursday",
"fri", "friday",
"sat", "saturday",
"sun", "sunday",
"topic", "create", "talk", "session", "workshop", "tell", "share", "coding", "venue", "about",
"speaker", "member",
"a", "i", "will", "be", "who", "want", "or", "have", "if", "go", "of", "with", "from", "for",
"the", "others", "another", "all", "which", "project",
"your", "you", "our", "you\"re", "we\"re", "we\'re",
"how","view","get","sponsor","thank","join",
"please","into","also","over","see"
],
auth0: {
domain: 'webuildsg.auth0.com',
clientId: process.env.WEBUILD_AUTH0_CLIENT_ID,
clientSecret: process.env.WEBUILD_AUTH0_CLIENT_SECRET,
clientToken: process.env.WEBUILD_AUTH0_CLIENT_TOKEN
},
githubParams: {
version: '3.0.0',
clientID: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
location: process.env.LOCATION || city,
maxUsers: process.env.MAX_USERS || 1000,
maxRepos: process.env.MAX_REPOS || 150,
starLimit: process.env.STAR_LIMIT || 50,
outfile: __dirname + '/cache.json'
},
meetupParams: {
key: process.env.MEETUP_API_KEY,
country: locationSymbol,
state: locationSymbol,
city: city,
category_id: 34, // Tech category
page: 500,
fields: 'next_event',
offset: 0,
blacklistGroups: objectToArray(snapshot.meetupBlacklistGroups)
},
eventbriteParams: {
token: process.env.EVENTBRITE_TOKEN,
url: 'https://www.eventbriteapi.com/v3/events/search',
venueUrl: 'https://www.eventbriteapi.com/v3/venues/',
organizerUrl: 'https://www.eventbriteapi.com/v3/organizers/',
categories: [
'102',
'119'
],
blacklistOrganiserId: objectToArray(snapshot.eventbriteBlacklistOrganiserIds)
}
})
})
}