Skip to content

Commit 762b641

Browse files
last 3 episodes
1 parent fd29daf commit 762b641

8 files changed

+2661
-15
lines changed

_podcast/s19e05-large-hadron-collider-and-mentorship.md

Lines changed: 887 additions & 0 deletions
Large diffs are not rendered by default.

_podcast/s19e06-ai-in-industry-trust-return-on-investment-and-future.md

Lines changed: 788 additions & 0 deletions
Large diffs are not rendered by default.

_podcast/s19e07-career-advice-learning-and-featuring-women-in-ml-and-ai.md

Lines changed: 964 additions & 0 deletions
Large diffs are not rendered by default.
34.3 KB
Loading
38.6 KB
Loading
41.2 KB
Loading

scripts/airtable.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def mark_record_processed(table, record_id):
7070
def process_person(record):
7171
fields = record['fields']
7272

73-
email = fields['email']
73+
email = fields['email'].strip()
7474

7575
name = fields['name']
7676
name = utils.clean_name(name)
@@ -93,9 +93,9 @@ def process_person(record):
9393

9494
if 'picture' in fields:
9595
picture_record = fields['picture'][0]
96-
image_location = picture_record['url']
96+
image_location = picture_record['url'].strip()
9797
elif 'picture_url' in fields:
98-
image_location = fields['picture_url']
98+
image_location = fields['picture_url'].strip()
9999
else:
100100
raise Exception('no image')
101101

@@ -213,9 +213,9 @@ def process_book(record):
213213

214214
if 'book_cover' in fields:
215215
picture_record = fields['book_cover'][0]
216-
image_location = picture_record['url']
216+
image_location = picture_record['url'].strip()
217217
elif 'book_cover_url' in fields:
218-
image_location = fields['book_cover_url']
218+
image_location = fields['book_cover_url'].strip()
219219
else:
220220
raise Exception('no image')
221221

@@ -282,12 +282,13 @@ def find_matching_podcasts_youtube(youtube_id):
282282
if 'youtube' not in event:
283283
continue
284284

285-
event_youtube_url = event['youtube']
285+
event_youtube_url = event['youtube'].strip()
286286
if '?v=' not in event_youtube_url:
287287
print(f'wrong url: {event_youtube_url}, skipping it...')
288288
continue
289289

290290
event_youtube_id = event_youtube_url.split('?v=')[1]
291+
event_youtube_id = event_youtube_id.strip()
291292

292293
if event_youtube_id == youtube_id:
293294
matches.append(event)
@@ -304,16 +305,17 @@ def process_podcast(record):
304305
season = int(fields['season'])
305306
episode = int(fields['episode'])
306307

307-
youtube_url = fields['youtube_url']
308+
youtube_url = fields['youtube_url'].strip()
308309
youtube_id = youtube_url.split('?v=')[1]
310+
youtube_id = youtube_id.strip()
309311

310312
matching_event = find_matching_podcasts_youtube(youtube_id)
311313

312-
title = matching_event['title']
314+
title = matching_event['title'].strip()
313315
short = matching_event.get('short', title)
314316

315317
if 'slug' in matching_event:
316-
slug = matching_event['slug']
318+
slug = matching_event['slug'].strip()
317319
else:
318320
slug = utils.slugify_title(short)
319321

@@ -322,10 +324,10 @@ def process_podcast(record):
322324
podcast_id = f's{season:02d}e{episode:02d}-{slug}'
323325
image_path = f'images/podcast/{podcast_id}.jpg'
324326

325-
apple_url = fields['apple_url']
326-
spotify_url = fields['spotify_url']
327+
apple_url = fields['apple_url'].strip()
328+
spotify_url = fields['spotify_url'].strip()
327329

328-
anchor_url = fields['anchor_url']
330+
anchor_url = fields['anchor_url'].strip()
329331
anchor_url = anchor_url.replace('/pod/pod/', '/pod/')
330332

331333
anchor_id = anchor_url[len('https://anchor.fm/datatalksclub/episodes/'):]
@@ -425,15 +427,15 @@ def pull_events():
425427
def process_event(record):
426428
fields = record['fields']
427429

428-
email = fields['email']
430+
email = fields['email'].strip()
429431
speaker = utils.lookup_author_id(email)
430432

431-
title = fields['event_title']
433+
title = fields['event_title'].strip()
432434

433435
date_raw = fields['date']
434436
date = utils.parse_date(date_raw)
435437

436-
url = fields['url']
438+
url = fields['url'].strip()
437439
event_type = fields['event_type']
438440

439441
params = {

scripts/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
from jinja2 import Template
1212

1313

14+
def strip(s):
15+
if s:
16+
return s.strip()
17+
return ""
18+
1419
def clean_name(name):
1520
tokens = name.strip().split()
1621
return ' '.join(tokens)

0 commit comments

Comments
 (0)