Giter Site home page Giter Site logo

good_morning's Introduction

Good Morning

Send a daily text (or MMS) with configurable info (weather, stocks, etc)

Usage

$ cargo run <twilio_auth_token> <to_number>

Example:

# Using Cargo
$ cargo run b3000465822a90bef67011e8fea44fa +15556667788

# Running binary directly without cargo:
$ ./target/debug/good_morning b3000465822a90bef67011e8fea44fa +15556667788

Response (Received as SMS):

Rise and Shine! Currently 16 C and Breezy. Today Partly Cloudy with a high of 16 and low of 0. Today's sunset is at 7:51 pm.
AMZN Range: 912.11-921.86

Configuration

src/conf/
├── cloudinary_conf.json
├── message_conf.json
└── twilio_conf.json

src/cloudinary_conf.json:

  • upload_preset for accessing cloudinary API to upload MMS images src/message_conf.json
  • message settings (destination number, city location, etc)
  • toggle SMS and/or MMS delivery src/twilio_conf.json
  • account settings (Account SID, Twilio From Number)

Scheduling

Want a message every weekday morning at 8 a.m.? The easiest way is to an cronjob entry like the following (use crontab -e to edit):

00 08 * * 1-5 ( cd ~/good_morning/ ; RUST_BACKTRACE=1 ~/good_morning/target/debug/good_morning <TWILIO_ACCOUNT_SID> <DEST_NUMBER> >> /tmp/good_morning_runlog.txt 2>&1  )

Example:
  00 08 * * 1-5 ( cd ~/good_morning/ ; RUST_BACKTRACE=1 ~/good_morning/target/debug/good_morning b3000465822a90bef67011e8fea44fae +15556667890 >> /tmp/good_morning_runlog.txt 2>&1  )

Notes:

  • Use crontab -l to verify entry has been created
  • See /tmp/good_morning_runlog.txt for trace and successful responses. /tmp/ is regularly cleared of its contents, so choose another directory for long term logs
  • Replace ~/good_morning to your source directory for this project

Notes

  • Requires a Twilio account for SMS and MMS messages
  • SMS Character limit is 1600
  • Requires a Cloudinary account for hosting MMS message images

TODO

  • Allow multiple providers to host images
  • Improve MMS image

good_morning's People

Contributors

at1as 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.