Skip to content

Commit

Permalink
Merge pull request #2 from placeAtlas/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans5958 authored Jul 20, 2023
2 parents d065ed7 + 22e4337 commit 9db9da0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When you're happy with the shape you've drawn, press <kbd>Finish</kbd>. You will
- **Website**: If you're describing a project, the project's main website would be suitable here.
- **Subreddit**: Format it like `r/subreddit`.
- **Discord**: Write the invite code, that the invite link without the `discord.gg/` part.
- **Wiki**: The page title of [The r/place Wiki](https://place-wiki.stefanocoding.me/).
- **Wiki**: The page title of [the r/place Wiki](https://place-wiki.stefanocoding.me/).

All fields but the name are optional. For example, a country flag doesn't necessarily need a description.

Expand Down Expand Up @@ -88,7 +88,7 @@ Hereforth is an example of the structured data. The example has been expanded, b
"name": "An entry",
"description": "This is an entry, it is remarkable.",
"links": {
"subreddit": ["placeAtlas2", "subreddit1", "subreddit2"],
"subreddit": ["placeAtlas2023", "subreddit1", "subreddit2"],
"discord": ["pJkm23b2nA"],
"website": ["https://example.com"],
"wiki": ["An_Entry", "An_Entry_2"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) to learn how to submit a new entr
[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat)](#contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key))):
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
Expand Down
12 changes: 6 additions & 6 deletions tools/oneoff/redditflairset.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ def set_flair(submission, flair):
total_all_flairs = 0
rejected_count = 0
processed_count = 0
for submission in reddit.subreddit('placeAtlas2').new(limit=1000):
#for submission in reddit.subreddit('placeAtlas2').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="top"):
#for submission in reddit.subreddit('placeAtlas2').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="comments"):
#for submission in reddit.subreddit('placeAtlas2').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="hot"):
#for submission in reddit.subreddit('placeAtlas2').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="new"):
#for submission in reddit.subreddit('placeAtlas2').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="relevance"):
for submission in reddit.subreddit('placeAtlas2023').new(limit=1000):
#for submission in reddit.subreddit('placeAtlas2023').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="top"):
#for submission in reddit.subreddit('placeAtlas2023').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="comments"):
#for submission in reddit.subreddit('placeAtlas2023').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="hot"):
#for submission in reddit.subreddit('placeAtlas2023').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="new"):
#for submission in reddit.subreddit('placeAtlas2023').search('flair:"New Entry"',limit=1000,syntax='lucene', sort="relevance"):
"""
Auth setup
1. Head to https://www.reddit.com/prefs/apps
Expand Down
2 changes: 1 addition & 1 deletion tools/oneoff/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
users.add("Shovel_Ship");
users.add("Zequez");

for submission in reddit.subreddit('placeAtlas2').new(limit=10000):
for submission in reddit.subreddit('placeAtlas2023').new(limit=10000):
try:
users.add(submission.author.name)
except AttributeError:
Expand Down
10 changes: 5 additions & 5 deletions tools/redditcrawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def set_flair(submission, flair):
with open('temp-atlas-manual.txt', 'w', encoding='utf-8') as FAIL_FILE:

submission: Submission
for submission in reddit.subreddit('placeAtlas2').new(limit=1000):
for submission in reddit.subreddit('placeAtlas2023').new(limit=1000):
total_all_flairs += 1

print(f"{submission.id}: Submitted {humanize.naturaltime(datetime.utcnow() - datetime.utcfromtimestamp(submission.created_utc))}.")
Expand All @@ -104,7 +104,7 @@ def set_flair(submission, flair):

print(f"{submission.id}: Processing...")

if submission.link_flair_text == "New Entry" or submission.link_flair_text == "Edit Entry" or True:
if submission.link_flair_text == "New Entry" or submission.link_flair_text == "Edit Entry":

try:

Expand All @@ -122,9 +122,9 @@ def set_flair(submission, flair):
if submission_json:

if submission.link_flair_text == "Edit Entry":
assert submission_json["id"] > 0, "Edit invalid because ID is tampered, it must not be 0 or -1!"
assert submission_json["id"] != -1, "Edit invalid because ID is tampered, it must not be -1!"
else:
assert submission_json["id"] <= 0, "Addition invalid because ID is tampered, it must be 0 or -1!"
assert submission_json["id"] == -1, "Addition invalid because ID is tampered, it must be -1!"

submission_json_dummy = {"id": submission_json["id"], "_reddit_id": submission.id, "_author": submission.author.name}

Expand All @@ -137,7 +137,7 @@ def set_flair(submission, flair):
assert validation_status < 3, \
"Submission invalid after validation. This may be caused by not enough points on the path."

with open(f'{patches_dir}reddit-{submission.id}-{"-".join(submission["name"].split()).lower()}.json', 'w', encoding='utf-8') as out_file:
with open(f'{patches_dir}reddit-{submission.id}-{"-".join(submission.name.split()).lower()}.json', 'w', encoding='utf-8') as out_file:
out_file.write(json.dumps(submission_json, ensure_ascii=False))

count_success += 1
Expand Down
2 changes: 1 addition & 1 deletion web/_js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ window.prodDomain = prodDomain
const instanceId = "2023"
window.instanceId = instanceId

const instanceSubreddit = "placeAtlas2"
const instanceSubreddit = "placeAtlas2023"
window.instanceSubreddit = instanceSubreddit

const instanceRepo = "https://github.com/placeAtlas/atlas-2023"
Expand Down
4 changes: 3 additions & 1 deletion web/_js/main/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ function initDraw() {
let lShiftPressed = false
let shiftPressed = false

let highlightUncharted = false
// @instance-only
// Default is false. When changing, also check HTML of #highlightUncharted
let highlightUncharted = true

renderBackground(atlas)
applyView()
Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ <h5>Draw</h5>
<button type="button" class="btn btn-secondary" id="resetButton">Reset</button>

<div class="form-check" id="highlightUnchartedLabel">
<input class="form-check-input" type="checkbox" id="highlightUncharted">
<input class="form-check-input" type="checkbox" id="highlightUncharted" checked>
<label class="form-check-label mb-0" for="highlightUncharted" title="Highlight uncharted areas of the map">
Highlight Empty
</label>
Expand Down

0 comments on commit 9db9da0

Please sign in to comment.