Skip to content

Commit 8d9c093

Browse files
committed
Ensure we always preprocess the same way
1 parent b4c1f15 commit 8d9c093

File tree

2 files changed

+59
-41
lines changed

2 files changed

+59
-41
lines changed

scripts/sync-sched/speakers.json

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@
171171
"about": "GraphQL TSC Member and GraphQL Java founder. Working on all things GraphQL at Atlassian.",
172172
"location": "",
173173
"url": "",
174-
"avatar": "http://avatars.sched.co/1/ac/21066795/avatar.jpg.320x320px.jpg?e5e",
174+
"avatar": "//avatars.sched.co/1/ac/21066795/avatar.jpg.320x320px.jpg?e5e",
175175
"role": "speaker",
176-
"socialurls": []
176+
"socialurls": [],
177+
"tags": "",
178+
"~syncedDetailsAt": 1749493186105
177179
},
178180
{
179181
"username": "andrei.bocan",
@@ -183,9 +185,11 @@
183185
"about": "Andrei is a professional book hoarder who frequently complains about software.",
184186
"location": "",
185187
"url": "",
186-
"avatar": "http://avatars.sched.co/f/c3/21066797/avatar.jpg.320x320px.jpg?012",
188+
"avatar": "//avatars.sched.co/f/c3/21066797/avatar.jpg.320x320px.jpg?012",
187189
"role": "attendee, speaker",
188-
"socialurls": []
190+
"socialurls": [],
191+
"tags": "",
192+
"~syncedDetailsAt": 1749493186105
189193
},
190194
{
191195
"username": "andrew.doyle1",
@@ -195,9 +199,11 @@
195199
"about": "Andy Doyle is a technologist with over 30 years experience building systems. He currently works for the House of Representatives modernizing applications that support the legislative process.",
196200
"location": "",
197201
"url": "",
198-
"avatar": "http://avatars.sched.co/e/7d/21066800/avatar.jpg.320x320px.jpg?55c",
202+
"avatar": "//avatars.sched.co/e/7d/21066800/avatar.jpg.320x320px.jpg?55c",
199203
"role": "speaker",
200-
"socialurls": []
204+
"socialurls": [],
205+
"tags": "",
206+
"~syncedDetailsAt": 1749493186105
201207
},
202208
{
203209
"username": "ankita25",
@@ -207,9 +213,11 @@
207213
"about": "Ankita is the co-founder and CEO of Akto.io. Prior to Akto she has experience working in VMware, LinkedIn and JP Morgan. She holds MBA from Dartmouth College and Bachelors in Technology from IIT Roorkee.",
208214
"location": "San Francisco",
209215
"url": "https://akto.io/",
210-
"avatar": "http://avatars.sched.co/9/a0/21265832/avatar.jpg.320x320px.jpg?b49",
216+
"avatar": "//avatars.sched.co/9/a0/21265832/avatar.jpg.320x320px.jpg?b49",
211217
"role": "speaker",
212-
"socialurls": []
218+
"socialurls": [],
219+
"tags": "",
220+
"~syncedDetailsAt": 1749493186105
213221
},
214222
{
215223
"username": "annyce.davis",
@@ -231,9 +239,11 @@
231239
"about": "Anthony Miller leads the development of Apollo GraphQL’s iOS client library. He has a passion for client-side infrastructure, quality API design, and writing far too many unit tests. Outside of Apollo, Anthony enjoys board gaming with friends, watching movies, and relaxing by the pool.",
232240
"location": "",
233241
"url": "",
234-
"avatar": "http://avatars.sched.co/5/01/21066803/avatar.jpg.320x320px.jpg?46c",
242+
"avatar": "//avatars.sched.co/5/01/21066803/avatar.jpg.320x320px.jpg?46c",
235243
"role": "attendee, speaker",
236-
"socialurls": []
244+
"socialurls": [],
245+
"tags": "",
246+
"~syncedDetailsAt": 1749493186105
237247
},
238248
{
239249
"username": "antoine.carossio",
@@ -255,9 +265,11 @@
255265
"about": "We are building Pacha, an incredible tool that helps you build powerful AI applications that connect to any kind of data source with authorization, give LLMs a programmatic runtime and structured memory to eliminate context loss.",
256266
"location": "San Francisco, California",
257267
"url": "askpacha.ai",
258-
"avatar": "http://avatars.sched.co/3/3e/21460012/avatar.jpg.320x320px.jpg?925",
268+
"avatar": "//avatars.sched.co/3/3e/21460012/avatar.jpg.320x320px.jpg?925",
259269
"role": "attendee, speaker",
260-
"socialurls": []
270+
"socialurls": [],
271+
"tags": "",
272+
"~syncedDetailsAt": 1749493186105
261273
},
262274
{
263275
"username": "ardatanrikulu",
@@ -305,9 +317,11 @@
305317
"about": "I am a self-taught senior software architect, with a distinguishing trait of resiliently finding simple solutions to complex problems using communication through words and code. Starting from my first Lego set, I've been in love with development throughout my whole life. As a creator, having the ability to turn thoughts into reality is a gift I find essential. Forever learning through practical applications, bad decisions and positive thoughts - I, ultimately, turned a hobby into an obsession.",
306318
"location": "Sarajevo",
307319
"url": "https://the-guild.dev/",
308-
"avatar": "http://avatars.sched.co/6/a9/18743810/avatar.jpg.320x320px.jpg?ec6",
320+
"avatar": "//avatars.sched.co/6/a9/18743810/avatar.jpg.320x320px.jpg?ec6",
309321
"role": "speaker",
310-
"socialurls": []
322+
"socialurls": [],
323+
"tags": "",
324+
"~syncedDetailsAt": 1749493186105
311325
},
312326
{
313327
"username": "benjie3",
@@ -377,12 +391,14 @@
377391
"company": "Tyk",
378392
"position": "Director of Product Ecosystems",
379393
"name": "Budhaditya Bhattacharya",
380-
"about": "Budha is the director of product ecosystems at Tyk, where he leads product education, ecosystem expansion, and open standards adoption. \n \nAs the board chair of the OpenAPI Initiative, he is responsible for membership growth and driving the adoption of OAS, Arazzo, and Overlays. \n \nPart product strategist, part developer advocate, and part storyteller, he’s on a mission to remove friction from API ecosystems by breaking down tech complexities preferably with a great metaphor and a well-placed pun.",
394+
"about": "Budha is the director of product ecosystems at Tyk, where he leads product education, ecosystem expansion, and open standards adoption. <br /> <br /> As the board chair of the OpenAPI Initiative, he is responsible for membership growth and driving the adoption of OAS, Arazzo, and Overlays. <br /> <br /> Part product strategist, part developer advocate, and part storyteller, he’s on a mission to remove friction from API ecosystems by breaking down tech complexities preferably with a great metaphor and a well-placed pun.",
381395
"location": "Durham, NC",
382396
"url": "https://www.linkedin.com/in/budha-b/",
383-
"avatar": "http://avatars.sched.co/1/fe/17694866/avatar.jpg.320x320px.jpg?7a7",
397+
"avatar": "//avatars.sched.co/1/fe/17694866/avatar.jpg.320x320px.jpg?7a7",
384398
"role": "attendee, speaker",
385-
"socialurls": []
399+
"socialurls": [],
400+
"tags": "",
401+
"~syncedDetailsAt": 1749493186105
386402
},
387403
{
388404
"username": "christian.ernst",
@@ -404,9 +420,11 @@
404420
"about": "Christian is currently a Senior Software Engineer at Booking.com. For the last three years Christian has been working to drive the GraphQL initiative across the company by helping teams adopt build new features leveraging GraphQL.",
405421
"location": "",
406422
"url": "",
407-
"avatar": "http://avatars.sched.co/9/39/21066804/avatar.jpg.320x320px.jpg?fff",
423+
"avatar": "//avatars.sched.co/9/39/21066804/avatar.jpg.320x320px.jpg?fff",
408424
"role": "attendee, speaker",
409-
"socialurls": []
425+
"socialurls": [],
426+
"tags": "",
427+
"~syncedDetailsAt": 1749493186105
410428
},
411429
{
412430
"username": "christian.stangier",
@@ -416,9 +434,11 @@
416434
"about": "Christian is a Software Engineer at MOIA GmbH, a company trying to improve urban transportation with ride-pooling. With over 12 years of experience as a full-stack developer, Christian is currently focused on building real-time tooling for fleet operators with GraphQL on serverless AWS.",
417435
"location": "",
418436
"url": "",
419-
"avatar": "http://avatars.sched.co/a/5f/21066807/avatar.jpg.320x320px.jpg?a7c",
437+
"avatar": "//avatars.sched.co/a/5f/21066807/avatar.jpg.320x320px.jpg?a7c",
420438
"role": "attendee, speaker",
421-
"socialurls": []
439+
"socialurls": [],
440+
"tags": "",
441+
"~syncedDetailsAt": 1749493186105
422442
},
423443
{
424444
"username": "danadajian",

src/app/conf/_api/sched-client.tsx

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,7 @@ export async function getSpeakers(
137137

138138
const result = users
139139
.filter(speaker => speaker.role?.includes("speaker"))
140-
.map(user => {
141-
const res = {
142-
...user,
143-
socialurls: user.socialurls || [],
144-
about: preprocessDescription(user.about),
145-
}
146-
147-
for (const field of SPEAKER_IGNORED_FIELDS) {
148-
delete res[field as keyof typeof res]
149-
}
150-
delete res.role
151-
152-
return res
153-
})
140+
.map(shapeSpeaker)
154141
.sort((a, b) => {
155142
if (a.avatar && !b.avatar) return -1
156143
if (!a.avatar && b.avatar) return 1
@@ -172,12 +159,7 @@ export async function getSpeakerDetails(
172159
term: username,
173160
})
174161

175-
for (const field of SPEAKER_IGNORED_FIELDS) {
176-
delete data[field as keyof typeof data]
177-
}
178-
delete data.role
179-
180-
return data as SchedSpeaker
162+
return shapeSpeaker(data as SchedSpeaker)
181163
}
182164

183165
function preprocessDescription(description: string | undefined | null): string {
@@ -190,3 +172,19 @@ function preprocessDescription(description: string | undefined | null): string {
190172
// we'll improve how the descriptions look later down the tree in the session details page
191173
return stripHtml(res).result
192174
}
175+
176+
function shapeSpeaker(user: SchedSpeaker): SchedSpeaker {
177+
const res = {
178+
...user,
179+
socialurls: user.socialurls || [],
180+
about: preprocessDescription(user.about),
181+
}
182+
183+
for (const field of SPEAKER_IGNORED_FIELDS) {
184+
delete res[field as keyof typeof res]
185+
}
186+
delete res.role
187+
188+
return res
189+
}
190+
}

0 commit comments

Comments
 (0)