Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Find out if it is the weekend with Ruby on Rails and the Nexmo SMS API

License

Notifications You must be signed in to change notification settings

nexmo-community/ruby-sms-weekend-checker

Repository files navigation

Check If It Is The Weekend Web Scraping App

Deploy

This is a Ruby on Rails web app that scrapes once a day isittheweekend.com to find out if today is the weekend and sends an update to all subscribers via SMS using the Vonage SMS API.

Prerequisites

  • Ruby on Rails
  • A Vonage account
  • A Vonage phone number

Installation

To install this application:

  • Clone this repository locally
  • Run bundle install and rake db:migrate from the command line

Usage

Running Locally

To use this application:

  • Set up a Vonage account
  • Purchase a Vonage phone number
  • Start your ngrok server from the command line
  • Update your number's webhook address in the Vonage Dashboard to your ngrok URL
    • i.e. https://my-ngrok-url.ngrok.io/webhooks/event
  • Copy the .env.sample file to .env and fill in the values for the variables
    • VONAGE_API_KEY: Your Vonage API key
    • VONAGE_API_SECRET: Your Vonage API secret
    • FROM_NUMBER: Your Vonage provisioned phone number
  • Run whenever --update-crontab from the command line to set up the daily scraping task
  • Start your Rails server
  • Visit localhost:3000 in your browser and add your phone number on the form
  • As long as your web server is running you will receive a once-daily SMS message

Deploying to Heroku

  • Click the Deploy to Heroku button on the top
  • Set up the environment variables when prompted and complete set up
  • Once it is set up, schedule the Rake scraper:check_site_update task using the Heroku Scheduler

License

This project is under the MIT License

About

Find out if it is the weekend with Ruby on Rails and the Nexmo SMS API

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published