Last weekend I finally got around to building something with Meteor and what follows is a short description of my experience with the platform with a few take aways.
Installing Meteor is super straightforward
$ curl https://install.meteor.com/ | sh
| // report spotting is declared through Meteor.methods({}) on the server | |
| Meteor.call('reportSpotting',spotting, function(err,res){}); |
| // poor man's Meteorjs | |
| // endpoint should be : ws://yourapplication.meteor.com/websocket | |
| var Meteor = { | |
| call : function(methodName, params, callback){ | |
| var options = { | |
| endpoint: ApplicationSettings.meteorSocketEndpoint, | |
| SocketConstructor: WebSocket | |
| }; |
| chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){ | |
| // look at the message and see if it has report data | |
| // extract data and look for Meteor traces | |
| // contact app server | |
| // adjust UI | |
| }); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="/scripts/settings.js"></script> | |
| <script src="/scripts/archive.js"></script> | |
| <script src="/scripts/identity.js"></script> | |
| <script src="/scripts/ddp.js"></script> | |
| <script src="/scripts/meteor.js"></script> | |
| <script src="/scripts/background.js"></script> | |
| </head> |
| var scripts = document.querySelectorAll("head > script") || []; | |
| var reportData = []; | |
| for(var i=0; i<scripts.length; i++){ | |
| if(scripts[i].innerHTML){ | |
| reportData.push({ | |
| content : scripts[i].innerHTML | |
| }); | |
| } | |
| } |
| "content_scripts": [ | |
| { | |
| "matches": [ | |
| "http://*/*", "https://*/*" | |
| ], | |
| "js": [ | |
| "scripts/inject.js" | |
| ], | |
| "css": [ | |
| "css/animate.css", |
| git clone https://github.com/callmephilip/chatzilla.git | |
| cd chatzilla | |
| heroku login | |
| heroku create | |
| heroku labs:enable websockets -a YOUR-APP-NAME | |
| git push heroku master | |
| heroku open |
| from gevent import monkey | |
| from flask import Flask | |
| monkey.patch_all() | |
| application = Flask(__name__) | |
| application.debug = True | |
| application.config['PORT'] = 5000 | |
| //http://css-tricks.com/perfect-full-page-background-image/ | |
| html { | |
| background: url(images/bg.jpg) no-repeat center center fixed; | |
| -webkit-background-size: cover; | |
| -moz-background-size: cover; | |
| -o-background-size: cover; | |
| background-size: cover; | |
| } |