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
| def self.find(name) | |
| @name = name | |
| @messages = JSON.parse(settings.ironcache.cache(@name).get('messages').value) | |
| Channel.new(@name, @messages) | |
| end |
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
| @call = @client.account.calls.create( | |
| :from => '+14159341234', | |
| :to => '+18004567890', | |
| :url => 'http://example.com/call-handler' | |
| ) |
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
| {"host":"smtp.sendgrid.net", "domain":"MY DOMAIN eg: yahoo.com", "port":587, "username":"MY USERNAME", "password":"MY PASSWORD", "from":"MY EMAIL", "to":"EMAIL TO SEND TO", "subject":"SUBJECT", "body":"BODY"} |
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 'rest' | |
| rest = Rest::Client.new | |
| response = rest.get("https://mq-aws-us-east-1.iron.io/1/projects/MY_PROJECT_ID/queues/github-webhook-queue/messages?oauth=MY_TOKEN") | |
| # Parse IronMQ json | |
| parsed = JSON.parse(response.body) | |
| raise "No message found!" if parsed['messages'].length == 0 | |
| parsed['messages'].each do |m| |
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
| curl -H "Authorization: OAuth TOKEN" -H "Content-Type: application/json" \ | |
| -d '{"push_type":"multicast", "subscribers": [{"url": "http://mysterious-brook-1807.herokuapp.com/ironmq_push_1"}, {"url": "http://mysterious-brook-1807.herokuapp.com/ironmq_push_2"}], "error_queue": "pushq-demo-1-errors"}' \ | |
| "https://mq-aws-us-east-1.iron.io/1/projects/PROJECT_ID/queues/pushq-demo-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
| curl -H "Content-Type: application/json" -H "Authorization: OAuth TOKEN" \ | |
| -d '{"messages":[{"body":"hello world!"}]}' \ | |
| "http://mq-aws-us-east-1.iron.io/1/projects/PROJECT_ID/queues/pushq-demo-1/messages" |
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
| curl -H "Authorization: OAuth TOKEN" -H "Content-Type: application/json" \ | |
| "http://mq-aws-us-east-1.iron.io/1/projects/PROJECT_ID/queues/pushq-demo-1/messages/MESSAGE_ID/subscribers" |
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
| {"subscribers":[ | |
| { | |
| "retries_delay":60, | |
| "retries_remaining":2, | |
| "status_code":200, | |
| "status":"deleted", | |
| "url":"http://mysterious-brook-1807.herokuapp.com/ironmq_push_2", | |
| "id":"5831237764476661217" | |
| },{ | |
| "retries_delay":60, |
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
| { | |
| "ids":["5831237764476661216"], | |
| "msg":"Messages put on queue." | |
| } |
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
| { | |
| "subscribers": [ | |
| {"url": "ironmq:///q2"}, | |
| {"url": "ironmq:///q3"}, | |
| {"url": "ironmq:///q4"}, | |
| {"url": "ironworker:///my_awesome_worker"}, | |
| {"url": "http://my.domain.com/do_some_action"} | |
| ] | |
| } |