The MapPorn Redditbot is a suite of scripts that help automate and simplify moderation at /r/MapPorn.
Map Contest Tools
A raspberry pi runs the script checkforsubmissions.py every hour checking that inbox. When the bot receives a submission, it parses the message and adds a new line to a csv with the following fields:
- Map Name
- Map Image URL
- Map Description
- Map Author
- Unique identifier for the submission
This CSV is used to create a Reddit contest post at the end of the month. The manually run script votingpost.py reads this CSV and creates a comment for each map submission. Users can upvote or downvote each comment.
While this is going on the CSV is renamed to submissions_current. That way if the RedditBot receives a new map submission it won't be confused in the current queue of maps being voted on.
After about a week, the contest ends. Then the script congratulations.py is manually run. This script gets the four highest rated comments (maps) and uses that data to make a new post to congratulate the winners. The CSV of submissions from that month is archived for a yearly contest at the end of the year.
Social Media Tools
Part of MapPorn's mission is to share maps across the internet. This means using platforms other than Reddit. In the python file functions.py there are functions for taking posts from /r/MapPorn and posting to Twitter, Tumblr and Facebook simultaneously. These functions use official APIs to interact with and post a link to a Reddit post to those accounts.
Some other social media scripts include:
- shotgunblast.py: A simple script that takes the shortlink to a Reddit post and shares it on social media
- multi-post_top_of_week.py: a script to share the top /r/MapPorn post of the week to social media
- top_of_month.py: same idea but shares top post of the month
- WeeklySubmit.py: posts an image to social media to advertise the map contest and solicit submissions
- papertowns_topoftheday.py: shares the top post of the day from /r/Papertowns to social media
- oldmaps_topoftheday.py: same idea but for /r/OldMaps
See requirements.txt for full list of requirements. These scripts utilize PRAW, Tweepy, PyTumblr and Facebook-sdk. These packages require authorization tokens that are not provided in this repository.
Created by /u/Petrarch1603