Skip to content

Instantly share code, notes, and snippets.

View ianjennings's full-sized avatar

Ian Jennings ianjennings

View GitHub Profile
window.moteio_config = {
api_version: '0.1',
app_name: 'Hype Machine',
blocks: [
{
type: 'notify'
},
{
type: 'search',
action: function(query) {
window.moteio_config = {
api_version: '0.1',
app_name: 'Hype Machine',
blocks: [...]
}
window.moteio_update = function() {
window.moteio_rec.notify($('.artist_title').text(), $('.song_title').text(), $('.album_icon').prop('src'));
setTimeout(function(){
window.moteio_update();
}, 1000);
}
blocks: [
{
type: 'notify'
},
...
]
blocks: [
{
type: 'search',
action: function(query) {
alert(query);
}
}
...
]
blocks: [
{
type: 'buttons',
data: [
{
press: function () {
window.moveUp();
...
},
icon: 'chevron-up'
{
type: 'select',
data: [
{
optgroup: 'Latest',
text: 'Latest',
action: function() {
window.location = "/latest";
}
},
// transfer button states
if($('#playerPlay').hasClass('play')) {
window.moteio_rec.updateButton('play', 'play', null);
}
if($('#playerPlay').hasClass('pause')) {
window.moteio_rec.updateButton('play', 'pause', null);
}
if($('#playerFav').hasClass('fav-on')) {
window.moteio_rec.updateButton('heart', null, '#ff0000');
} else {
window.moteio_config.blocks[0].data[0].press()
var server = https.createServer(options, app);
var io = require('socket.io').listen(server);
server.listen(config.port);