Skip to content

Instantly share code, notes, and snippets.

@gynvael
Created March 19, 2023 15:36
Show Gist options
  • Save gynvael/0f9e229c3a0ad308fc91c0a7233bd4df to your computer and use it in GitHub Desktop.
Save gynvael/0f9e229c3a0ad308fc91c0a7233bd4df to your computer and use it in GitHub Desktop.
GPT-4 input 1 adhoc script
#!/usr/bin/python3
import csv
def e(s):
return s.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('\n', '<br>').replace('', '*')
print("""
<html>
<style>
body {
font-family: Roboto,RobotoDraft,Helvetica,Arial,sans-serif;
}
div.entry {
margin: 0;
margin-top: 2em;
margin-bottom: 2em;
padding: 1em;
background: #eef2ff;
}
</style>
<body>
""")
with open('cfp.csv', newline=None) as csvfile:
reader = csv.reader(csvfile)
first = True
for row in reader:
if first:
first = False
continue
r = [e(x) for x in row]
id, name, last_name, _, _, _, company, bio, topic, category, level, abstract, language, additional = r[:14]
if not topic and not abstract:
continue
print(f"""
<div class="entry">
<p>
<b>Id</b>: {id}<br>
<b>Who</b>: {name} {last_name} / {company}<br>
<b>What</b>: {topic}<br>
<b>For</b>: {category} / {level} / {language}<br>
</p>
<p><b>Abstract:</b><br>{abstract}</p>
<p><b>Additional:</b><br>{additional}</p>
<p><b>Bio:</b><br>{bio}</p>
</div>
""")
print("""
</body>
</html>
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment