Giter Site home page Giter Site logo

annuhdo / metric_units_reddit_bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cannawen/metric_units_reddit_bot

0.0 2.0 0.0 317 KB

Reddit bot converting imperial units to metric units

Home Page: https://www.reddit.com/user/metric_units

License: GNU General Public License v3.0

Shell 0.76% JavaScript 99.24%

metric_units_reddit_bot's Introduction

Build status

What does the bot do?

The bot finds comments with imperial units, and replies with metric units. See ./test/converter-test.js for what conversions are currently supported, and see Pivotal Tracker for what's coming up next.

There is a chance it will reply to certain triggers like "good bot". See personality-test.js for what the triggers are.

How does the code work?

This is a javascript app built with Node.js, and all of the app code is in the src directory.

The app starts in bot.js, and it polls the Reddit servers in an infinite loop. The app has two major components:

converter.js and conversion_helper.js are responsible for converting imperial units to metric units.

personality.js create sassy responses to certain trigger words

Running the code

Create your bot's reddit account.

Create a reddit script app through your reddit preferences. (Use http://localhost as your redirect url, we don't need it.) From there, you should be able to get your OAuth username and secret

Download the bot's code, and create a file ./private/environment.yaml that looks like sample-environment.yaml

run npm install then node ./src/bot.js and you should have the bot up and running!

Note: You can run the bot in development mode (which won't POST requests to reddit servers) by changing the dev-mode environment variable to "true"

Running the tests

run npm test

To run a single spec, add .only

Questions or Comments?

Feel free to drop by the subreddit or open a github issue

Contribute

Metric Units Bot is participating in Hacktoberfest! See a list of things we need help with and win free T-shirts! You can also take a look at what's in Pivotal Tracker or come up with your own improvements

Feedback & code reviews are always welcome.

License

This source is distributed under GNU GPLv3

Pull requests or derivative works welcome. but please don't make a freedom_units_bot just to spite me D:

metric_units_reddit_bot's People

Contributors

bclingan avatar cannawen avatar esclear avatar fbontin avatar miporto avatar nitinkgp23 avatar

Watchers

 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.