Skip to content

Commit 9148cdf

Browse files
committed
minor fixes
1 parent 1180e75 commit 9148cdf

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

GovCrawler_at.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131
)
3232

3333
#create a thread with the latest protocol
34-
toot = toot = mastodon.status_post(re.search(r"(.+)/(.+)", last_protocol)[2] + " #test", visibility="unlisted", spoiler_text="test, Hackathon 0x11")
34+
toot = toot = mastodon.status_post(re.search(r"(.+)/(.+)", last_protocol)[2], visibility="unlisted")
3535
for top in protocol:
3636
try:
3737
for annex in top['annexes']:
3838
annexes += f" {annex['bka_url']}"
3939
print(f"Top {top['top']}: {top['title']} {annexes}")
40-
toot = mastodon.status_reply(toot, f"Top {top['top']}: {top['title']} {annexes} #test")
40+
toot = mastodon.status_reply(toot, f"Top {top['top']}: {top['title']} {annexes}")
4141
annexes = ""
4242
except:
4343
try:
4444
print(top[f"{top['undefined']}"])
45-
toot = mastodon.status_reply(toot, f"{top['undefined']} #test")
45+
toot = mastodon.status_reply(toot, f"{top['undefined']}")
4646
except:
4747
try:
48-
print(f"{top['pdf_name']} {top['bka_url']}")
49-
toot = mastodon.status_reply(toot, f"{top['pdf_name']} {top['bka_url']} #test")
48+
print(f"{top['pdf_title']} {top['bka_url']}")
49+
toot = mastodon.status_reply(toot, f"{top['pdf_title']} {top['bka_url']}")
5050
except:
5151
print("ERROR: There is no known Element in the protokoll JSON")
5252
with open(f"{protocol_dir}tooted.txt", 'a') as f:

data/council-of-ministers-protocol.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ protocol_json.onreadystatechange = function() {
1212
if (typeof protocol[i].top !== 'undefined') { //for TOPs with annexes
1313
for (let ii in protocol[i].annexes) {
1414
if (typeof protocol[i].annexes[ii].bka_url !== 'undefined' && protocol[i].annexes[ii].bka_url.length > 0) {
15-
annexes_element = "<li><a href='" + protocol[i].annexes[ii].bka_url + "'>" + protocol[i].annexes[ii].pdf_name + "</a></li>";
15+
annexes_element = "<li><a href='" + protocol[i].annexes[ii].bka_url + "'>" + protocol[i].annexes[ii].pdf_title + "</a></li>";
1616
}
1717
}
1818
if (typeof annexes_element !== 'undefined') {
@@ -24,7 +24,7 @@ protocol_json.onreadystatechange = function() {
2424
} else if (typeof protocol[i].undefined !== 'undefined') { //for text without TOP
2525
top_element.innerHTML = protocol[i].undefined;
2626
} else if (typeof protocol[i].bka_url !== 'undefined') { //for annexes without TOP
27-
top_element.innerHTML = "<a href='" + protocol[i].bka_url + "'>" + protocol[i].pdf_name + "</a>";
27+
top_element.innerHTML = "<a href='" + protocol[i].bka_url + "'>" + protocol[i].pdf_title + "</a>";
2828
} else {
2929
top_element.innerHTML = "ERROR: There is no known Element in the protokoll JSON";
3030
}

minster.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,20 @@ def main():
134134
pdf_name = pdf_name.replace('/', '_')
135135
pdf_path = os.path.join(pdfs_dir, pdf_top.replace('/', '_'), pdf_name)
136136
print(f'pdf_top {pdf_top}')
137-
print(f'pdf_name {pdf_name}')
137+
print(f'pdf_title {pdf_title}')
138138
print(f'pdf_path {pdf_path}')
139139
print(f'pdf_link {pdf_link}')
140140
if pdf_top != "none":
141141
for top in text:
142142
try:
143143
if top['top'] == re.search(r"[0-9]+/([0-9\.]+)", pdf_top)[1]:
144144
print(f'pdf_top {pdf_top} gefunden')
145-
top['annexes'].append({"bka_url":pdf_link,"local_path":pdf_path,"pdf_name":pdf_name})
145+
top['annexes'].append({"bka_url":pdf_link,"local_path":pdf_path,"pdf_title":pdf_title})
146146
break
147147
except:
148-
print(f'{top['undefined']} has no top nr')
148+
print(f"{top['undefined']} has no top nr")
149149
else:
150-
text.append({"bka_url":pdf_link,"local_path":pdf_path,"pdf_name":pdf_name})
150+
text.append({"bka_url":pdf_link,"local_path":pdf_path,"pdf_title":pdf_title})
151151

152152
mkdir_p(os.path.dirname(pdf_path))
153153
download_file(pdf_link, pdf_path)

0 commit comments

Comments
 (0)