Coder Social home page Coder Social logo

sharat / mood Goto Github PK

View Code? Open in Web Editor NEW

This project forked from krausefx/mood

1.0 1.0 0.0 437 KB

Keeping track of current level of happiness

Home Page: https://krausefx.com

License: MIT License

Ruby 95.11% HTML 1.22% Shell 3.67%
ruby bot telegram telegram-bot docker

mood's Introduction

mood

If today were the last day of my life, would I want to do what I am about to do today?" And whenever the answer has been "No" for too many days in a row, I know I need to change something.

Steve Jobs

Background

I've been a heavy user of 1 Second Everyday, where I created a very personal video of the full year for the last 730 days. (Check out a public sample video here)

One thing I noticed is that I associate the mood and happiness when seeing the videos, however, I know that this will slowly fade away as time passes.

I wanted a way to track my overall happiness and excitement in my life, allowing me to monitor, analyze and react to it. As Steve Jobs said, if you notice a downwards trend, it might be time to apply some changes to your life.

How it works

It's a simple Telegram Bot that will send you a message 3 times a day:

  • One in the morning (I'd never reply to the bot before showering)
  • One after lunch
  • One when going to bed

You can always just text your bot a number, however, I know I'd forget it. That's why the bot sends you those reminders.

It then pulls up this really nice, optimized keyboard in Telegram, with a short description of what each number means.

If you forget to track a day, that's no big deal at all. The database is simple, it looks like this:

@_db.create_table :moods do
  primary_key :id
  DateTime :time
  Integer :value
end

I decided not to store the information about breakfast, lunch and dinner, as it would make time zones more complex.

Stripped out Felix's content here

How to use it

You'll have to setup a few things

  • Create a Telegram bot using @BotFather and get the API key, and message ID with you
  • Provide those values using TELEGRAM_TOKEN and TELEGRAM_CHAT_ID
    • To get the TELEGRAM_CHAT_ID, send a message to your bot and then access the following URL in your browser https://api.telegram.org/bot[TELEGRAM_TOKEN]/getUpdates. You'll see a message, and within that, the Chat ID to use
  • And host it on any server, like Heroku, and use the Heroku scheduler feature to call rake morning, rake noon and rake evening
  • Make sure the Heroku worker is enabled

End of Felix Readme

Deploy to Heroku

Deploying the code on Heroku is the addition changes made in the forked repository. This uses GitHub Action to make a simple container-based build process using Heroku CLI. Heroku look for HEROKU_API_KEY and HEROKU_APP as environment variables. Configure this under Settings/Secrets page. Have a looka at .github/workflows/push.yml. Currently it deploys every push made in the repo. You can configure this per branch. Read More*.

mood's People

Contributors

ashfurrow avatar krausefx avatar orenyomtov avatar revolter avatar rsrbk avatar sharat avatar

Stargazers

 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.