Closed BigLep closed 2 years ago
This was generated using
from pydiscourse import DiscourseClient
import json
import csv
import io
client = DiscourseClient(
'https://discuss.ipfs.io/',
api_username='BigLep',
api_key='')
# Get the tracks JSON
# curl https://2022.ipfs-thing.io/events.json -o /tmp/tracks.json
# Manually modify session tracks that want to ignore
with open('/tmp/tracks.json', 'r') as tracks_fp:
tracks = json.load(tracks_fp)
outputs = []
for file_name, track in tracks.items():
if "website" in track and "discuss.ipfs.io" in track["website"]:
print(f"Skipping {file_name} because it has {track['website']}")
continue
title = f"π€ {track['date']}: {track['name']}"
content = f"Placeholder for links (e.g., slides, videos) and notes about the talks in https://github.com/ipfs-shipyard/ipfs-thing-2022/tree/main/events/{file_name} . See https://discuss.ipfs.io/t/about-the-ipfs-thing-2022-category/14608/2 for more info."
post = client.create_post(content, title=title, category_id=32)
url = f"https://discuss.ipfs.io/t/{post['topic_slug']}/{post['topic_id']}"
outputs.append([file_name, title, url ])
with io.StringIO("some initial text data") as formatted_output:
writer = csv.writer(formatted_output, delimiter='\t')
writer.writerows(outputs)
print(formatted_output.getvalue())
See https://github.com/ipfs-shipyard/ipfs-thing-2022/issues/110 for context
Here are the list of files/tracks/URLs added:
This should be squashed into a single commit.