Skip to content

samarth641/Reddit2Insta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instagram Reddit Meme Bot

This bot scrapes memes from random subreddits and posts them to Instagram. It uses PRAW to scrape memes from Reddit and instabot to post memes to Instagram.

Prerequisites

  • Python 3.8 or higher
  • pip
  • virtualenv
  • Instagram account
  • Reddit account

Installation

  1. Clone the repository and navigate into the directory:
git clone https://github.com/samarth641/Reddit2Insta.git
  1. Install the required modules by Running this code In terminal:
pip install -r requirements.txt 
  1. Create a Reddit application and a corresponding client ID and client secret. Instructions can be found Here.

  2. Create an Instagram account and generate an API key. You can skip this step and only use your instagram account username and password as we are only using that to connect to InstagramAPI Documentation Here.

  3. Go to .env file in the root of the directory and add the following variables with your own credentials:

REDDIT_CLIENT_ID=<your_reddit_client_id>
REDDIT_CLIENT_SECRET=<your_reddit_client_secret>
REDDIT_USERNAME=<your_reddit_username>
REDDIT_PASSWORD=<your_reddit_password>
REDDIT_USER_AGENT=<your_reddit_user_agent>
INSTA_USERNAME=<your_instagram_username>
INSTA_PASSWORD=<your_instagram_password>

Changing subreddits

To change the subreddits that the bot scrapes memes from, edit the subreddits variable in the reddit2insta.py file. Add or remove subreddits as needed, and separate them by commas. For example:

subreddits = ['subreddit1', 'subreddit2', 'subreddit3', 'subreddit']

Changing Square Background Colour (Optional)

Read the reddit2insta.py file to modify the square background color used to make images comply with Instagram's picture rules. To alter the fill color to any RGB color, go to Line 51 where we define the function to generate a square. You can find the RGB color code for any color from Here

For example:

def make_square(im, min_size=1080, fill_color=(0, 0, 0, 0)):

To

def make_square(im, min_size=1080, fill_color=(255, 255, 255, 0)):
  1. Run the bot:
python reddit2insta.py

Configuration

  • subreddits: A list of subreddits to scrape memes from. Replace the default subreddits with your own.
  • directory: The directory where the downloaded memes will be saved.
  • posted_memes.json: A JSON file that keeps track of the memes that have been posted to Instagram.

Contributing

Contributions are welcome! Please open an issue or pull request for any changes you would like to make.

🔗 Social Links

Buy me a Coffee

instagram

linkedin

twitter

Authors

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages