Giter VIP home page Giter VIP logo

churning-flair-selector-site's Introduction

/r/churning Flair Selector

This is a site that allows users of a subreddit to select flair. This was specifically made for /r/churning but can be easily adapted to any other subreddit. The announcement for this service was made here.

Set up

Create a file called config.js. It should have the following format:

module.exports = {
  web_app_secret: "",
  web_app_id: "",
  redirect: "",
  mod_username: "",
  mod_password: "",
  mod_script_id: "",
  mod_script_secret: "",
  subreddit: ""
};

You must first navigate to the apps page for the account you want to handle the flair selection. That URL is https://www.reddit.com/prefs/apps/.

When there, you need to create 2 apps. You must create a web app (which will handle the retrieval of user profile information) and you must also create a personal script app. You will have 2 sets of app IDs and secrets. The personal script is what is actually used to set the user flair.

Note that the user must A) be a mod of the subreddit and B) must have the flair permission.

Key Value
web_app_secret Web application secret
web_app_id Web application id
redirect Redirect url (i.e. while developing, http://localhost:3000, while in prod https://churning.us)
mod_username Username of mod account
mod_password Password of mod account
mod_script_id Personal script id
mod_script_secret Personal script secret
admin_pass HTTP Auth password for the admin page
subreddit Subreddit that the user is a mod of

Development

Copy and paste the following section to get started.

git clone [email protected]:jonluca/Churning-Flair-Selector-Site.git
cd Churning-Flair-Selector-Site
echo 'module.exports = {
        web_app_secret: "",
        web_app_id: "",
        redirect: "",
        mod_username: "",
        mod_password: "",
        mod_script_id: "",
        mod_script_secret: "",
        admin_pass: "",
        subreddit: ""
      };' > config.js
yarn install

Fill out the sections in config.js, then start the application with npm start or node bin/www.

The other part you'll need to change is the front end filtering logic in public/js/main.js. Currently it assumes a format similar to that in public/data/flairs.json, which is for airports, since this application was originally made for /r/churning. You'll want to change the logic around displaying, filtering, and retrieving the various flair options.

Maintenance

This is currently maintained by @jonluca on GitHub and /u/JonLuca on reddit. Feel free to fork this and modify it for your subreddit. This site is provided with the MIT license.

churning-flair-selector-site's People

Contributors

jasonharrison avatar jonluca avatar renovate-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

churning-flair-selector-site's Issues

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.