This file contains hidden or 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 'digest' # Not needed if you are using rails. | |
require 'cgi' # Not needed if you are using rails. | |
secret_key = "SECRET_KEY" # Your secret | |
params = { :email => "CUSTOMER_EMAIL", :uuid => "ACCOUNT_ID" } # Your api call parameters | |
string_to_hash = params.sort{|x,y| x[0].to_s <=> y[0].to_s}.reduce(secret_key){|x,y| x + y.to_s} # Concatenate in alphabetical order of parameter name, prepend with secret_key | |
params[:sig] = Digest::MD5.hexdigest(string_to_hash) # Compute hash | |
api_url = "http://loyalty.500friends.com/api/enroll.gif?" + params.map{|x,y| "#{x}=#{CGI::escape(y)}"}.join("&") # Construct the url. | |
api_url # should be the url of the api call |
This file contains hidden or 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
<script src="https://d3aa0ztdn3oibi.cloudfront.net/javascripts/ff.loyalty.widget.js" type="text/javascript"></script> | |
<iframe id="ff_member_iframe" style="width:760px; height:1045px; border:0" frameBorder="0"></iframe> | |
<script type='text/javascript'> | |
_ffLoyalty.initialize( "ACCOUNT_ID" ); | |
_ffLoyalty.loadIframe({ 'page' : 'program_overview' }); | |
</script> |
This file contains hidden or 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
# Support for Rspec / Capybara subdomain integration testing | |
# Make sure this file is required by spec_helper.rb | |
# | |
# Sample subdomain test: | |
# it "should test subdomain" do | |
# switch_to_subdomain("mysubdomain") | |
# visit root_path | |
# end | |
DEFAULT_HOST = "lvh.me" |
This file contains hidden or 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
namespace "x.x.x.x" do | |
desc "bar" | |
task :foo => [:environment] do | |
# foo implementation goes here | |
end | |
end | |
namespace "y.y.y.y" do |
This file contains hidden or 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
<script src="https://d3aa0ztdn3oibi.cloudfront.net/javascripts/ff.loyalty.widget.js" type="text/javascript"> | |
<script type="text/javascript"> | |
_ffLoyalty.initialize("YOUR_ACCOUNT_ID"); | |
$BV.ui("submission_container", { | |
onEvent: function(json){ | |
if (json.pageType = "Preview") { | |
_ffLoyalty.setUserEmail(); | |
} | |
if (json.pageStatus == "REVIEW_THANKYOU" && json.eventSource == "Display") { |
This file contains hidden or 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
<?php | |
// PHP example of using API to notify CronSentry upon a job completion | |
// For API documentation please go to http://www.cronsentry.com/help#api | |
// set POST variables | |
$url = 'http://api.cronsentry.com/api/v1/notifications'; | |
$parameters = array( | |
'api_key' => 'YOUR_API_KEY', | |
'job_name' => urlencode('Your job name'), | |
'status' => 1, |
This file contains hidden or 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
# Python example of using API to notify CronSentry upon a job completion | |
# For API documentation please go to http://www.cronsentry.com/help#api | |
import urllib | |
import requests | |
# set POST variables | |
url = 'http://api.cronsentry.com/api/v1/notifications' | |
parameters = { | |
'api_key' : 'YOUR_API_KEY', |
This file contains hidden or 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
# Ruby example of using API to notify CronSentry upon a job completion | |
# For API documentation please go to http://www.cronsentry.com/help#api | |
require 'open-uri' | |
require 'rest_client' | |
# set POST variables | |
url = 'http://api.cronsentry.com/api/v1/notifications' | |
api_key = 'YOUR_API_KEY' | |
job_name = URI::encode('Your job name') |