Start style
This commit is contained in:
parent
92d25dc356
commit
6f55b74c26
@ -1,10 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Saved Posts</title>
|
||||
</head>
|
||||
<head>
|
||||
<title>Saved Posts</title>
|
||||
<style></style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Saved Posts</h1>
|
||||
<!--posts-->
|
||||
</body>
|
||||
<body>
|
||||
<h1>Saved Posts</h1>
|
||||
<!--posts-->
|
||||
</body>
|
||||
</html>
|
3
html/style.css
Normal file
3
html/style.css
Normal file
@ -0,0 +1,3 @@
|
||||
a {
|
||||
display: block;
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Upvoted Posts</title>
|
||||
</head>
|
||||
<head>
|
||||
<title>Upvoted Posts</title>
|
||||
<style></style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Upvoted Posts</h1>
|
||||
<!--posts-->
|
||||
</body>
|
||||
<body>
|
||||
<h1>Upvoted Posts</h1>
|
||||
<!--posts-->
|
||||
</body>
|
||||
</html>
|
3
save.py
3
save.py
@ -34,6 +34,9 @@ for post in get_posts(client):
|
||||
with open(os.path.join("html", html_file)) as f:
|
||||
html = f.read()
|
||||
|
||||
with open(os.path.join("html", "style.css")) as f:
|
||||
html = html.replace("<style></style>", f"<style>\n{f.read()}\n</style>")
|
||||
|
||||
html = html.replace("<!--posts-->", "\n".join(posts_html))
|
||||
|
||||
with open(os.path.join(location, html_file), "w") as f:
|
||||
|
@ -15,7 +15,7 @@ def make_client():
|
||||
|
||||
|
||||
def get_saved_posts(client):
|
||||
for saved in client.user.me().saved(limit=None):
|
||||
for saved in client.user.me().saved(limit=10):
|
||||
if saved.__class__.__name__ == "Submission":
|
||||
yield saved
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user