Merge branch 'master' into smaller-image

This commit is contained in:
ash 2022-04-06 22:57:19 +01:00 committed by GitHub
commit 6c83e2ec43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 374 additions and 513 deletions

View file

@ -3,6 +3,7 @@
import json
import time
import re
import os
outfile = open('temp_atlas.json', 'w', encoding='utf-8')
failfile = open('manual_atlas.json', 'w', encoding='utf-8')
@ -25,7 +26,9 @@
for item in existing:
existing_ids.append(item['id'])
total_all_flairs = 0
duplicate_count = 0
outfile.write("[\n")
for submission in reddit.subreddit('placeAtlas2').new(limit=2000):
"""
Auth setup
@ -47,10 +50,14 @@
4. Pull Request
"""
#print(dir(submission))
total_all_flairs += 1
if (submission.id in existing_ids):
print("Found first duplicate!")
break
duplicate_count += 1
if (duplicate_count > 50):
break
else:
continue
if(submission.link_flair_text == "New Entry"):
text = submission.selftext
#Old backslash filter:
@ -73,7 +80,7 @@
lines[i] = line.replace("\"id\": 0", "\"id\": "+"\""+str(submission.id)+"\"")
text = "\n".join(lines)
try:
outfile.write(json.dumps(json.loads(text))+",\n")
outfile.write(json.dumps(json.loads(text))+" ,\n")
successcount += 1
except json.JSONDecodeError:
failfile.write(text+",\n")
@ -81,4 +88,10 @@
print("written "+submission.id+" submitted "+str(round(time.time()-submission.created_utc))+" seconds ago")
totalcount += 1
print(f"\n\nSuccess: {successcount}/{totalcount}\nFail: {failcount}/{totalcount}\nPlease check manual_atlas.txt for failed entries to manually resolve.")
# Remove ,\n
outfile.seek(outfile.tell()-4, os.SEEK_SET)
outfile.truncate()
outfile.write("\n]")
print(f"\n\nTotal all flairs:{total_all_flairs}\nSuccess: {successcount}/{totalcount}\nFail: {failcount}/{totalcount}\nPlease check manual_atlas.txt for failed entries to manually resolve.")

View file

@ -78,6 +78,7 @@ a:hover {
}
button,
#exportDirectPost,
#aboutBackButton,
#drawBackButton {
background-image: linear-gradient(to bottom, #888, #666);
@ -103,6 +104,7 @@ button:disabled:hover {
}
button:hover,
#exportDirectPost:hover,
#aboutBackButton:hover,
#drawBackButton:hover {
background-image: linear-gradient(to bottom, #999, #777);

View file

@ -76,7 +76,7 @@ <h2 id="abouth2">The 2022 /r/place Atlas</h2>
<p>This is an Atlas aiming to chart all the artworks created during the <a href="https://www.reddit.com/r/place/">/r/place</a> April's fools event on <a href="https://www.reddit.com/" target="_blank">Reddit</a> in 2022.</p>
<p>The original code was developed by <a href="/" target="_blank" rel="author">Roland Rytz</a> (<a href="mailto:roland.rytz@gmail.com" target="_blank">mail</a>, <a href="https://reddit.com/user/draemmli/" target="_blank">reddit</a>) and is available under the free <a href="https://www.gnu.org/licenses/agpl-3.0.en.html" target="_blank">AGPL license</a> on <a target="_blank" href="https://github.com/RolandR/place-atlas">GitHub</a>.</p>
<br>
<p>The currently maintained version of the website is managed by <a href="/" target="_blank" rel="author">Stefano Haagmans</a> and is obtainable under the same license within a <a target="_blank" href="https://github.com/Codixer/place-atlas">Github Fork</a>.</p>
<p>The currently maintained version of the website is managed by <a href="/" target="_blank" rel="author">Stefano Haagmans</a> and is obtainable under the same license within a <a target="_blank" href="https://github.com/placeAtlas/atlas">Github Fork</a>.</p>
<p>Image's provided by <a target="_blank" href="https://place.thatguyalex.com/">Alex Tsernoh</a></p>.
<p>Maintaining and updating the website takes work, but I enjoy doing it for free and giving this to people. But if you would like to support me, or the people who helped me with contributions to this project. You're free to support us though <a target="_blank" href="https://paypal.me/codixer">Paypal</a>. (I don't have bitcoin)</p>
<p>To maintain the same tradition, I will also be offering stickers to anyone donating more then 20$ (Due to the size increase). But, you're not forced to do anything! This only shows appreciation to us and the people who've worked on this project</p>
@ -88,7 +88,7 @@ <h2 id="abouth2">The 2022 /r/place Atlas</h2>
<h2>How to contribute</h2>
<p>The /r/Place Atlas project relies on user contributions.</p>
<p>To contribute a label for an artwork, please read <a href="https://www.reddit.com/r/placeAtlas2/comments/tu203o/how_to_contribute/" target="_blank">this post on reddit</a> to learn how to submit a new entry.</p>
<p>Alternatively, contributions can be made directly on <a href="https://github.com/Codixer/place-atlas/blob/master/CONTRIBUTING.md">GitHub</a>.</p>
<p>Alternatively, contributions can be made directly on <a href="https://github.com/placeAtlas/atlas/blob/master/CONTRIBUTING.md">GitHub</a>.</p>
<p>The <a href="https://reddit.com/r/placeAtlas2/" target="_blank">/r/placeAtlas2</a> subreddit is also the place to submit all bug reports, feature requests or questions.</p>

File diff suppressed because one or more lines are too long

View file

@ -92,7 +92,7 @@ <h1 id="title">The 2022 /r/place Atlas</h1>
<noscript>
<p>Sorry, you need JavaScript to view the Atlas.</p>
<p>All JavaScript on this site is licensed under either the MIT or AGPL license.</p>
<p><a href="https://github.com/RolandR/place-atlas/">See the source on GitHub</a></p>
<p><a href="https://github.com/placeAtlas/atlas">See the source on GitHub</a></p>
</noscript>
</div>
</div>
@ -189,16 +189,22 @@ <h1 id="title">The 2022 /r/place Atlas</h1>
<div id="exportOverlay" class="overlay">
<div id="exportWindow">
<p>Please copy the text below and submit it as a<br>
new text post to <a target="_blank" href="https://www.reddit.com/r/placeAtlas2/">/r/placeAtlas2</a> on Reddit.</p>
<p>I will then check it and add it to the atlas.</p>
<div style="background-color:#666; padding:5px">
<p><b>Warning</b></p>
<p><b>DO NOT</b> include the character <b>"</b> (quotation marks) in your submission. It will not be approved.</p>
</div>
<textarea cols="50" rows="5" id="exportString"></textarea>
<p><b>Recommended:</b> Post directly after clicking this button. Don't forget to flair it with the "New Entry" tag. </p>
<div style="display:flex; flex-direction:column;align-items:center">
<a href="_blank" id="exportDirectPost">Post Direct to Reddit</a>
</div>
<hr style="border-bottom: solid black 1px"/>
<i>or...</i>
<p>Please copy the text below and submit it as a
new text post to <a target="_blank" href="https://www.reddit.com/r/placeAtlas2/">/r/placeAtlas2</a> on Reddit.</p>
<p>Don't forget to flair it with the "New Entry" tag.</p>
<p>We will then check it and add it to the atlas.</p>
<textarea cols="20" rows="5" id="exportString"></textarea>
<div style="display:flex; flex-direction:column;align-items:center">
<button id="exportCloseButton">Done</button>
</div>
</div>
@ -224,7 +230,7 @@ <h2>His Bitcoin Address</h2>
</div>
</div>
<div id="author">
Code by <a href="https://draemm.li/various/place-atlas/" target="_blank" rel="author">Roland Rytz</a>. Source on <a target="_blank" href="https://github.com/RolandR/place-atlas">GitHub</a> (<a target="_blank" href="https://github.com/Codixer/place-atlas">2022 Version Github</a>). Images provided by <a target="_blank" href="https://place.thatguyalex.com/">Alex Tsernoh</a>.
Code by <a href="https://draemm.li/various/place-atlas/" target="_blank" rel="author">Roland Rytz</a>. Source on <a target="_blank" href="https://github.com/placeAtlas/atlas">GitHub</a>, Images provided by <a target="_blank" href="https://place.thatguyalex.com/">Alex Tsernoh</a>. This site is powered by <a href="https://www.netlify.com">Netlify</a>.
</div>
</div>
<script type="text/javascript" src="./_js/infoblock.js?version=1.0"></script>