Giter Site home page Giter Site logo

twittertoreddit's Introduction

Twitter to Reddit

Simple python bot that crossposts tweets with a specific hashtag/user to reddit

Setup

Add a constants.py file in the subdirectory that looks like the following and add your keys.

global reddit_client_id
global reddit_client_secret
global reddit_client_refresh
global twitter_consumer_key
global twitter_consumer_key_secret

# From here: https://apps.twitter.com/app/new
twitter_consumer_key = ''
twitter_consumer_key_secret = ''

# From here: https://www.reddit.com/prefs/apps/
reddit_client_id = ''
reddit_client_secret = ''
reddit_redirect_uri = ''
reddit_client_refresh = '' # Look below how to get the refresh token

Get reddit refresh token

Just follow the steps on this site, which I find super helpful. The needed scope is submit.

Alternatively here is the provided tutorial by the praw-Library

Run the bot

python main.py

twittertoreddit's People

Contributors

l3d00m avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

twittertoreddit's Issues

Outdated API - changes to submit and authentication

With the latest API, it seems there should be a few changes to utils.py:

  1. set_oauth_app_info is deprecated - all that info can go in the praw.reddit() initialisation
  2. reddit_auth.submit() should now be reddit_auth.subreddit(subreddit).submit()
  3. I think there's some issues with refresh_access_information - I've commented it out for now and added refresh_token=constants.reddit_client_refresh to praw.reddit()

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.