Coder Social home page Coder Social logo

reagentx / reddit-folder-post-scheduler Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 0.0 79 KB

Reddit/Imgur API client to scan a local folder of photos and autopost them.

License: GNU General Public License v3.0

Python 100.00%
social-media automation python-3 imgur reddit autoposter

reddit-folder-post-scheduler's Introduction

reddit-folder-post-scheduler

A "set-it-and-forget-it" Python program to handle automation of media posts to Reddit from a directory of files on the host machine.

The core of this program is the Scheduler object, which is constructed with a pathlib.Path, a list of Subreddits, and an Imgur API Client ID. When a scheduler object's make_posts() method is called, it will:

  1. Select a photo randomly from the directory
  2. Log the filename to log/log.txt
  3. Upload the image to Imgur anonymously
  4. Submit the Imgur link to each Subreddit in the list
  5. Log each submission's permalink to log/links.txt

Example Code

This will create a scheduler object that looks in the directory /Users/chris/Pics/Dir-Of-Photos/ and post it to the subs ['sub_1', 'sub_2', 'sub_3', 'sub_4'].

from pathlib import Path
s = scheduler.Scheduler(
    Path('/Users/chris/Pics/Dir-Of-Photos'),
    ['sub_1', 'sub_2', 'sub_3', 'sub_4'],
    'imgur_client_id'
)
s.make_posts()

Setup

  • Clone this repo
  • cd to the folder
  • python3.7 -m venv venv
  • Activate your virtual environment
  • python setup.py develop
  • pip install -r requirements.txt

Usage Suggestions

To "set-it-and-forget-it," install the package on a machine that is always online (i.e. a VPS or even a Raspberry Pi on your network) and use cron:

0 12 * * * cd Projects/reddit-folder-post-scheduler/ && . venv/bin/activate && python scripts/script.py

Notes

reddit-folder-post-scheduler's People

Contributors

dependabot[bot] avatar reagentx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.