Skip to content

Instantly share code, notes, and snippets.

@uchoaaa
Created October 30, 2014 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uchoaaa/c5691336a80035914408 to your computer and use it in GitHub Desktop.
Save uchoaaa/c5691336a80035914408 to your computer and use it in GitHub Desktop.
require 'httparty'
require 'cgi'
require 'time'
require 'active_support/time'
class Temporize
include HTTParty
base_uri 'https://api.temporize.net/v1'
format :json
basic_auth '...', '...'
def recurring
cron = CGI::escape("0 12 * * ?")
url = CGI::escape('http://example.com/callback') # Replace with your callback URL
Temporize.post("/events/#{cron}/#{url}")
end
end
t = Temporize.new
puts t.recurring.body # => failed to parse either date or cron expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment