GithubHelp home page GithubHelp logo

reddit-weekly's Introduction

Reddit-weekly

Reddit-weekly was born from the idea of getting a weekly newsletter from subreddits, so you don't have to browse it every other day.

Usage

python rewe.py --users database.json

The script will read a json file (a set of emails and reddit refresh tokens), then proceed to get a page of each subreddit a user is subscribed to, and send it to their email.

You can use your own app (id and secret) if you want to run it by yourself.

In order to send an email, it is necessary to have an existing email account, so that there is an actual sender.

Setup

Firstly, go to reddit apps and register a new app. You'll need the personal use script id, and the secret. In case you aren't sure about the authentication process, read about it here. Next step is to create an email account. Currently, the script is using Gmail to log in, but there are plans (#3) to provide a way to plug-in a back-end that takes care of the emailing part.

Then, you need to generate your reddit's refresh token. The easiest way is to run this script. This token is used for authentication to get a reddit account's subreddits.

Note: only the identity and mysubreddits scopes are necessary from a user's account, so when this message come up:

Now enter a comma separated list of scopes, or all for all tokens:

Just enter with identity,mysubreddits.

Export all variables used by the script. For example:

export REWE_SENDER='place sender email here'
export REWE_PASS='place sender password gere'
export REWE_APP_ID='place client id here'
export REWE_APP_SECRET='place client secret here'

Create a json file (let's call it database.json) with all the desired target emails (emails to send the newsletter to), and their respective refresh token.

{
    "example1@mail_one.com": "refresh token 1",
    "example2@mail_two.com": "refresh token 2"
    // etc...
}

Only then you can run it:

./rewe.py --users database.json

And it will proceed to send a newsletter to each email in the json file.

Environment variables

  • REWE_SENDER: sender's email.
  • REWE_PASS: sender's email password.
  • REWE_APP_ID: reddit's app client id.
  • REWE_APP_SECRET: reddit's app client secret.

How does it look like

Screenshot of newsletter from r/programming:

reddit-weekly

License

This project is licensed under the MIT license. See LICENSE.

reddit-weekly's People

Contributors

feroldi avatar mattz0rt avatar thelink2012 avatar

Watchers

 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.