Created
October 30, 2014 13:02
-
-
Save uchoaaa/c5691336a80035914408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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