bill the user • Always try to post to both networks • Only post to a network when certain conditions permit • Only bill if we successfully post to both networks SOCIAL BLAST
Post Verify Credit Card Bill Credit Card Send Notification Post Twitter Verify Token Can Post Should Post Post Facbook Goal Met? Fail Pass Updated both networks? Finish Fail Start
Verify the OAuth token for the user's Facebook account. # Add some fakery so it feels like its working. raise if rand(100) == 0 ok = rand(100) > 5 if ok pass_passenger user else fail_passenger user end rescue error_passenger user end end end
Verify the OAuth token for the user's Facebook account. # Add some fakery so it feels like its working. raise if rand(100) == 0 ok = rand(100) > 5 if ok pass_passenger user else fail_passenger user end rescue error_passenger user end end end
Verify the OAuth token for the user's Facebook account. # Add some fakery so it feels like its working. raise if rand(100) == 0 ok = rand(100) > 5 if ok pass_passenger user else fail_passenger user end rescue error_passenger user end end end
Verify the OAuth token for the user's Facebook account. # Add some fakery so it feels like its working. raise if rand(100) == 0 ok = rand(100) > 5 if ok pass_passenger user else fail_passenger user end rescue error_passenger user end end end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end
billing = Billing.new lines << facebook # entry line since its the first added lines << twitter lines << billing connect_to twitter, :if_any => [facebook.passed, facebook.failed, facebook.errored] connect_to billing, :if_all => [facebook.passed, twitter.passed] goal billing.passed # extra attributes we want to log # these exist on the user log_options :passenger => [:id, :current_message] end