Skip to content

Commit

Permalink
Add interview with Zdeněk Vodák
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanqui committed Aug 11, 2024
1 parent f4eb574 commit 7c33b3f
Show file tree
Hide file tree
Showing 10 changed files with 344 additions and 25 deletions.
28 changes: 21 additions & 7 deletions scripts/gdoc_to_interview.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
# python scripts/gdoc_to_interview.py "/home/sanqui/Downloads/RedaktorovanrozhovoruLuborKopeck.docx.html" RS LK | wl-copy

import sys
from urllib import parse
import zipfile

from bs4 import BeautifulSoup
from bs4.element import Tag

filepath = sys.argv[1]
q_name = sys.argv[2]
a_name = sys.argv[3]
a_name = sys.argv[2]
q_names = sys.argv[3:]


if filepath.endswith(".zip"):
Expand Down Expand Up @@ -41,10 +42,10 @@
continue
first_span = span_tags[0]
text = first_span.text.rstrip(":  ").strip()
if text == q_name:
tag_name = "Q"
elif text == a_name:
if text == a_name:
tag_name = "A"
elif text in q_names:
tag_name = "Q"
else:
#print(f"Warning: Skipping paragraph {p}")
#print()
Expand All @@ -57,11 +58,24 @@

span_tags[1].replace_with(span_tags[1].text.lstrip(":  "))

a_tags: list[Tag] = tag.find_all('a')
for a_tag in a_tags:
href = a_tag.get('href')
if href.startswith("#"):
continue
assert href.startswith('https://www.google.com/url?'), href
# https://www.google.com/url?q=https://cs.wikipedia.org/wiki/Intel_80386&sa=D&source=editors&ust=1723386333606518&usg=AOvVaw2D6ohO13sB_Ku5-DV0ltXM
url = parse.urlparse(href)
query = parse.parse_qs(url.query)
for k, v in query.items():
if k == 'q':
a_tag['href'] = v[0]


p_text = str(tag.decode_contents())

print(f"""
<{tag_name} speaker="{speaker}">{p_text}</{tag_name}>
""")
<{tag_name} speaker={{{speaker}}}>{p_text}</{tag_name}>""")


if chapter_open:
Expand Down
24 changes: 18 additions & 6 deletions src/lib/Interview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
{ data.narrator.name }
</strong>
</div>
{ data.interview.project }
{#if data.interview.project }
{ data.interview.project.name }
{/if}

<hr>

Expand All @@ -43,7 +45,8 @@
{#if data.interview.interviewers }
<dt>Jméno tazatelů</dt>
<dd>
{#each data.interview.interviewers as person}
{#each data.interview.interviewers as person, i}
{#if i > 0},<br>{/if}
<NameWithShortname {person} />
{/each}
</dd>
Expand All @@ -57,17 +60,26 @@
<dt>Délka rozhovoru</dt>
<dd>{ data.interview.length }</dd>

<dt>Projekt</dt>
<dd>{ data.interview.project }</dd>

{#if data.interview.project }
<dt>Projekt</dt>
<dd>
{#if data.interview.project.url}
<a href={data.interview.project.url}>{ data.interview.project.name }</a>
{:else}
{ data.interview.project.name }
{/if}
</dd>
{/if}

{#if data.interview.transcriber }
<dt>Přepis</dt>
<dd><NameWithShortname person={data.interview.transcriber} /></dd>
<dd>{ data.interview.transcriber.name }</dd>
{/if}

{#if data.interview.redaction }
<dt>Redakce</dt>
<dd><NameWithShortname person={data.interview.redaction} /></dd>
<dd>{ data.interview.redaction.name }</dd>
{/if}

</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/InterviewBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
{/if}
{#if data.complete }
<p>
<strong>Datum:</strong> { data.interview.date.toLocaleDateString("cs-CZ") }
<strong>Datum:</strong> { data.interview.date ? data.interview.date.toLocaleDateString("cs-CZ") : "???" }
&nbsp;&bull;&nbsp;
<strong>Délka:</strong> { data.interview.length }
<strong>Délka:</strong> { data.interview.length || "???" }
</p>
{:else}
<!-- <p>Redakci tohoto proběhlého rozhovoru pro vás teprve připravujeme.</p> -->
Expand Down
2 changes: 1 addition & 1 deletion src/routes/interviews/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import InterviewBox from "$src/lib/InterviewBox.svelte";
let interviews: InterviewData[] = [kopecky_data, hrda_data, robinett_data, havelka_data, vodak_data, bezdek_data, hurnikova_data];
let interviews: InterviewData[] = [kopecky_data, vodak_data, hrda_data, robinett_data, havelka_data, bezdek_data, hurnikova_data];
</script>

<div class="thin">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/interviews/lubor-kopecky/interview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const data: InterviewData = {
place: "Dolní Město – Smrčensko (narátorův statek)",
interviewer: RS,
length: "1:46:51",
project: "Porevoluční videoherní scéna – Sleep Team",
project: {name: "Porevoluční videoherní scéna – Sleep Team"},
informed_agreement: true,
transcriber: {'name': "Alžběta Krejčí"},
redaction: RS,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/interviews/persons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export const RS: Person = {
export const VS: Person = {
name: "Vojtěch Straka",
shortname: "VS",
color: "brown"
color: "darkgreen"
}
Loading

0 comments on commit 7c33b3f

Please sign in to comment.