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
var app = express.createServer( | |
express.static(__dirname + '/public') | |
); | |
app.get( | |
'/discover', | |
function(req, res){ | |
var description = { | |
channel: clientPublishableChannelData, | |
subscription: clientSubscriptionData |
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
// ... callback continued from last gist | |
spire.subscribe( | |
'client-publishable-channel', | |
function(messages){ | |
for (var i=0;i<messages.length;i++){ | |
var content = messages[i].content; | |
var tnetnoc = content.split('').reverse().join(''); | |
spire.publish('client-subscribable-channel', tnetnoc, function(){}); | |
} | |
} |
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
spire.start(process.env.SPIRE_KEY, function(err, session) { | |
spire.channel( | |
'client-publishable-channel', | |
function(err, channel){ | |
if (!err) { | |
clientPublishableChannelData = {url: channel.data.url, capability: channel.data.capability}; | |
} | |
} | |
); |
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
var Spire = require('spire.io.js'); | |
var express = require('express'); | |
if (!process.env.SPIRE_KEY){ | |
console.log("You must set a SPIRE_KEY environment variable"); | |
process.exit(1); | |
} | |
var spire = new Spire(); | |
var clientSubscriptionData; |
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
test |
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
import spire | |
import requests | |
client = spire.Client('http://localhost:1337', key='1', async=False) | |
session = client.session() | |
print session.url | |
channel = session.channel() | |
channel.publish('mr watson. come here. i need you.') | |
session = client.session() |
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
Global channel: | |
============= | |
http://localhost:1337/session/6/channel/16 | |
None | |
[u'mr watson. come here. i need you.'] | |
Named channel: | |
============= | |
http://localhost:1337/session/6/channel/17 | |
foo | |
[u'What hath Shark wrought?'] |
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
Global channel: | |
============= | |
[u'mr watson. come here. i need you.'] | |
Named channel: | |
============= | |
[u'What hath Shark wrought?'] | |
Subchannel: | |
============= | |
[u'Can you hear me now?'] |
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
import subprocess | |
for i in range(0,1500): | |
subprocess.call("convert -size 1024x768 plasma: image-%i.jpg" % i, shell=True) |
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
No Gecko sdk detected. Install xulrunner-dev to compile 64-bit Firefox extension.No srcs specified for selenium-core | |
** Invoke //rb:gem:build (first_time) | |
** Invoke build/selenium-webdriver-0.0.31.dev.gem (first_time) | |
** Invoke //rb:chrome (first_time) | |
** Invoke //rb:common (first_time) | |
** Execute //rb:common | |
Preparing: //rb:common in build/rb | |
** Invoke //rb:remote (first_time) | |
** Invoke //rb:common | |
** Execute //rb:remote |