lundi 25 février 2013

API Please

Where's the API?

If This Then That (ifttt.com) is a nice idea to link together different web services and allow some rule based automation.

They have a bunch of 'channels' with 'triggers' (make a rule happen) and 'actions' (do something to this channel). Channels include blogger, facebook, twitter etc...

This is pretty nice (even if there's no Google+ channel, so I can't automatically duplicate everything from G+ over to facebook...., and the twitter channel doesn't trigger on received tweets....)

However, major lack : no open api to create your own channel? Something http REST based wouldn't be hard, and would let anyone create a channel into their app/web site etc... and then I could link onX into IFTTT and replicate my SMS feed to twitter....

All I can say is: WTF IFTT. Go REST & we'll all be LOL...

Javascript objects

JS does objects, but kind of weirdly...

A JS object class : it starts of as a function which is the constructor

function AcdBAPI() {
}

Add a STATIC method:
AcdBAPI.mystaticmethod = function(param1) {
}

An INSTANCE method
AcdBAPI.prototype.mymethod = function(param2) {
  this._myp = param2;
}

Instance variables : just referenced as this.varname

lundi 11 février 2013

Using KML in google maps

Well, I wanted to...
KML : https://developers.google.com/kml/documentation/?hl=fr

So I have a servlet, holding a list of POIs. And I return the KML as required...

To load google maps with a direct KML file or source:
https://maps.google.fr/maps?q=http://monserver.net/monservlet?action=get&name=mypoi
Normally this should work.... but although the map loads, it doesn't seem to want to show the pushpin with the POI...

What did I learn? that it looks nice and simple, but when it doesn't work its pretty hard to find out why....

vendredi 8 février 2013

Using onX to program my android phone in javascript

A very useful little app : as it allows 'rules' on your android phone with a near-complete access to the smartphone functionality from JS.


What is it good for? in my case, starting the music player at full volume when I plug in the headset cable in the car! 
Otherwise, I had to unlock the phone, select the music player, put the volume up to max (as otherwise its inaudible due to the 3.5mm jack hookup I use in my Touran), and press play... all while driving off..
Now, I just plug in the jack and it all happens automatically...

jeudi 7 février 2013

What did you learn today? Owt or nowt?

Maybe its age, but days seem to slip past too fast. So, a resolution; try to learn or experience one new techy thing every day and post it here.

Today's new thing : cross-domain client side web integration : use postMessage(). It has limitations (especially on IE : thanks microsoft) but does the job in a world of iframes...

Go here for info on the problem:
http://en.wikipedia.org/wiki/Same_origin_policy

Here's a good article explaining the use:
http://72lions.com/2011/05/cross-origin-communication-with-html5

and here's the browser support matrix:

http://caniuse.com/x-doc-messaging