Skip to content

Instantly share code, notes, and snippets.

View juggy's full-sized avatar
🎯
Focusing

Julien Guimont juggy

🎯
Focusing
View GitHub Profile
@juggy
juggy / Show Queue XML.xml
Created March 14, 2010 18:20
Bolide Q index XML
<qs account="bolide_account">
<q id="client_1">
<msg_count>0</msg_count>
<token>30b397d0-11c5-012d-0143-404077aa86f5</token>
<expire_on>2010-03-14T18:32:37+00:00</expire_on>
</q>
<q id="client_2">
<msg_count>3</msg_count>
<token>4b321ff0-11c5-012d-0143-404077aa86f5</token>
<expire_on>2010-03-14T19:32:37+00:00</expire_on>
@juggy
juggy / New or Update Queue
Created March 14, 2010 18:32
URL to Create or Update a Queue
PUT http://live.bolideapp.com/q/<q_name>.xml
@juggy
juggy / Show Queue URL
Created March 14, 2010 18:33
Get Queue Statuses
GET http://live.bolideapp.com/q.xml
GET http://live.bolideapp.com/q/<q_name>.xml
<msgs>
<!-- Select all Queues using regex -->
<msg select=".*">
<body>
<![CDATA[Data to send]]>
</body>
</msg>
<!-- Specify queues -->
@juggy
juggy / Send Message URL
Created March 14, 2010 18:42
Create Message URL
POST http://live.bolideapp.com/msg.xml
@juggy
juggy / Read Message URL
Created March 14, 2010 18:44
Client URL to read a message
GET http://live.bolideapp.com/<account>/<queue_name>/<valid_token>
@juggy
juggy / Errors and Warnings.xml
Created March 14, 2010 18:46
Errors and warnings return value
<errors>
<error> Can't be saved </error>
</errors>
<warnings>
<warning> Cannot send msg, queue does not exist</warning>
</warnings>
@juggy
juggy / bolide-client-use.rb
Created March 14, 2010 18:49
One way to use the bolide client api for ruby
require "bolide"
def load_bolide
# For use with rails: a client/q per session is created
@bolide = session[:bolide]
@q = session[:q]
if @bolide.nil?
# create a new session with Bolide
@bolide = Bolide::Account.new("bolide", "xxxx61d0-095c-012d-0076-404077aa86f5")
<!-- It uses prototype & the bolide.js found in the ruby plugin or at live.bolideapp.com -->
<script src="/javascripts/prototype.js?1267672430" type="text/javascript"></script>
<script src="http://live.bolideapp.com/js/bolide.js" type="text/javascript"></script>
<script type="text/javascript">
// With session ID and Token
bolide = new Bolide.Client("bolide", "b79c55c143df93241981c49aa97329f6", "cdcdaeb0-11c6-012d-0145-404077aa86f5", {
onSuccess: function(response){
print("Success", response);
},
@juggy
juggy / api auth.rb
Created March 14, 2010 19:06
API Auth
# Headers should be:
#
# X-Bol-Date: <Date of the request, format doesn't matter>
# X-Bol-Authentication: <MD5 Hash>
# Content-Type: application/xml
#
def headers
now = DateTime.now.to_s
{'X-Bol-Date'=>now, 'X-Bol-Authentication'=>auth_key(now), 'Content-Type'=>'application/xml'}
end