Start style
This commit is contained in:
parent
92d25dc356
commit
6f55b74c26
@ -1,10 +1,11 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Saved Posts</title>
|
<title>Saved Posts</title>
|
||||||
</head>
|
<style></style>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Saved Posts</h1>
|
<h1>Saved Posts</h1>
|
||||||
<!--posts-->
|
<!--posts-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Upvoted Posts</title>
|
<title>Upvoted Posts</title>
|
||||||
</head>
|
<style></style>
|
||||||
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Upvoted Posts</h1>
|
<h1>Upvoted Posts</h1>
|
||||||
<!--posts-->
|
<!--posts-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</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:
|
with open(os.path.join("html", html_file)) as f:
|
||||||
html = f.read()
|
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))
|
html = html.replace("<!--posts-->", "\n".join(posts_html))
|
||||||
|
|
||||||
with open(os.path.join(location, html_file), "w") as f:
|
with open(os.path.join(location, html_file), "w") as f:
|
||||||
|
@ -15,7 +15,7 @@ def make_client():
|
|||||||
|
|
||||||
|
|
||||||
def get_saved_posts(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":
|
if saved.__class__.__name__ == "Submission":
|
||||||
yield saved
|
yield saved
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user