├── .gitignore ├── open source meme.xcf ├── credits.txt ├── Makefile ├── post_meme.py ├── install_deps.sh └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | Build 2 | open_source_meme.png 3 | Build 4 | -------------------------------------------------------------------------------- /open source meme.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KCGD/openSourceSpidermanMeme/HEAD/open source meme.xcf -------------------------------------------------------------------------------- /credits.txt: -------------------------------------------------------------------------------- 1 | CONTRIBUTOR LIST 2 | ============================== 3 | KCGD (Creator) 4 | githubcatw [Narek] 5 | Xyphyn [Xylight] 6 | 7 | Taken from GitHub contributors. Update when needed. 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | meme: 2 | @if [ ! -d "Build" ]; then mkdir "Build"; fi 3 | 4 | convert -flatten open\ source\ meme.xcf Build/open_source_meme.png 5 | echo Meme compiled successfully. 6 | 7 | post: meme 8 | python3 post_meme.py 9 | 10 | install: meme 11 | @if [ ! -d "${HOME}/Pictures" ]; then mkdir "${HOME}/Pictures"; fi 12 | @if [ ! -d "${HOME}/Pictures/Memes" ]; then mkdir "${HOME}/Pictures/Memes"; fi 13 | cp Build/open_source_meme.png ${HOME}/Pictures/Memes/spiderman-meme.png 14 | -------------------------------------------------------------------------------- /post_meme.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | try: 4 | import praw 5 | except ModuleNotFoundError: 6 | print('Praw (python reddit api wrapper) is not installed. Installing it now...') 7 | os.system('python3 -m pip install praw') 8 | print('Praw installed. Please run the script again.') 9 | exit() 10 | pus = "" 11 | secret = "" 12 | 13 | def setupSecretAndPUS(): 14 | global pus, secret 15 | print(""" 16 | To post on Reddit you have to create an app. 17 | 18 | 1. Go to https://www.reddit.com/prefs/apps and click "create another app..." at the bottom. 19 | 20 | 2. Fill in the required details, make sure to select script — and click create app. 21 | 22 | 3. Enter the text under "personal use script" (app ID) and secret token here. 23 | """) 24 | pus = input("App ID: ") 25 | secret = input("Secret: ") 26 | 27 | def login(): 28 | u = input("Username: ") 29 | p = input("Password: ") 30 | reddit = praw.Reddit( 31 | client_id=pus, 32 | client_secret=secret, 33 | password=p, 34 | user_agent="OpenMeme/1.0", 35 | username=u 36 | ) 37 | reddit.validate_on_submit=True 38 | post(reddit) 39 | 40 | def post(reddit): 41 | title = input("Post title:") 42 | sub = os.environ.get("SUBREDDIT") 43 | if sub is None: 44 | sub = "linuxmemes" 45 | print(f"Posting meme to {sub}...") 46 | reddit.subreddit(sub).submit_image(title, "Build/open_source_meme.png") 47 | print("Meme has been posted.") 48 | 49 | if __name__ == "__main__": 50 | setupSecretAndPUS() 51 | login() 52 | 53 | -------------------------------------------------------------------------------- /install_deps.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/bash 2 | 3 | MAKE_DEPS=0 4 | POST_DEPS=0 5 | 6 | function show_help(){ 7 | echo "-?: show this list" 8 | echo "-m: install dependencies for building with make too" 9 | echo "-p: install dependencies for the 'post' make target too" 10 | exit 11 | } 12 | 13 | # parse args 14 | while getopts hmp flag 15 | do 16 | case "${flag}" in 17 | h) show_help;; 18 | m) MAKE_DEPS=1;; 19 | p) POST_DEPS=1;; 20 | esac 21 | done 22 | 23 | echo "welcome to the open source meme dependency installer. idk why i made this installer but oh well." 24 | echo "you may be asked for your password. this is so that the package manager can install the dependencies." 25 | read -p "what package manager do you want to use? (case sensitive): " pkgmgr 26 | echo "Installing GIMP." 27 | if [ $pkgmgr == "pacman" ]; then 28 | sudo $pkgmgr -S gimp 29 | else 30 | sudo $pkgmgr install gimp 31 | fi 32 | 33 | if [ $MAKE_DEPS == 1 ] || [ $POST_DEPS == 1 ]; then 34 | if [ -f "/etc/arch-release" ]; then 35 | echo "Installing ImageMagick." 36 | sudo pacman -S imagemagick 37 | else 38 | echo "Installing ImageMagick using imei." 39 | git clone https://github.com/SoftCreatR/imei /tmp/imei 40 | cd /tmp/imei 41 | chmod +x imei.sh 42 | sudo ./imei.sh 43 | rm -rf /tmp/imei 44 | fi 45 | fi 46 | 47 | if [ $POST_DEPS == 1 ]; then 48 | echo "Installing python3 and pip3." 49 | if [ -f "/etc/arch-release" ]; then 50 | if [ $pkgmgr == "pacman" ]; then 51 | sudo $pkgmgr -S python python-pip 52 | else 53 | sudo $pkgmgr install python python-pip 54 | fi 55 | else 56 | if [ $pkgmgr == "pacman" ]; then 57 | sudo $pkgmgr -S python3 python3-pip 58 | else 59 | sudo $pkgmgr install python3 python3-pip 60 | fi 61 | fi 62 | echo "Installing praw." 63 | pip3 install praw 64 | fi 65 | 66 | echo "Dependencies successfully installed." 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open source spiderman meme 2 | 3 | Haha spiderman make a presentation lol 4 | 5 | ## Install gimp 6 | 7 | This meme requires gimp, install through install_deps.sh 8 | 9 | ```bash 10 | chmod +x install_deps.sh && ./install_deps.sh 11 | ``` 12 | Alternativley, Install gimp through flatpak 13 | 14 | ```bash 15 | wget "https://flathub.org/repo/appstream/org.gimp.GIMP.flatpakref" 16 | ``` 17 | ```bash 18 | flatpak install org.gimp.GIMP.flatpakref 19 | ``` 20 | Load the meme in GIMP and edit however you wish. 21 | 22 | ## Build the meme using GIMP 23 | 24 | Clone the repository and load the meme into gimp 25 | ```bash 26 | git clone https://github.com/KCGD/openSourceSpidermanMeme.git 27 | cd openSourceSpidermanMeme 28 | ``` 29 | 30 | Open the meme by going in your cmdline and typing `gimp open\ source\ meme.xcf` 31 | Export your changes via File -> Export -> Choose Location -> Save 32 | 33 | ## Build the meme using make 34 | 35 | Install ImageMagick 7: 36 | ```bash 37 | chmod +x install_deps.sh && ./install_deps.sh -m 38 | ``` 39 | This installs ImageMagick 7 using pacman on Arch and derivatives or [imei](https://github.com/SoftCreatR/imei) on other distros. 40 | 41 | Then, build the meme using make: 42 | ```bash 43 | make # or make meme 44 | ``` 45 | 46 | Or, install the meme: 47 | ```bash 48 | make install 49 | ``` 50 | This builds the meme and copies it to `~/Pictures/Memes/spiderman-meme.png`. 51 | 52 | ## Post to Reddit 53 | 54 | First, install python3 and pip3 (if they aren't installed already). Then, install praw: 55 | ```bash 56 | pip3 install praw 57 | ``` 58 | Or use the installer: 59 | ```bash 60 | chmod +x install_deps.sh && ./install_deps.sh -p 61 | ``` 62 | Then you can create the post using make: 63 | ```bash 64 | make post 65 | ``` 66 | By default this posts the meme to r/linuxmemes. To post to a different subreddit set the SUBREDDIT variable: 67 | ```bash 68 | make post SUBREDDIT=windowsmemes # posts to r/windowsmemes 69 | ``` 70 | 71 | ## License 72 | [MIT](https://choosealicense.com/licenses/mit/) 73 | --------------------------------------------------------------------------------