var login = require('facebook-chat-api');
var users_position = new Array();

login({email: '', password: ''}, function callback (err, api) {
    if(err)
        return console.error(err);

    api.listen(function callback(err, message) {
        if (message.attachments[0]) {
            type = message.attachments[0].type;
            if (type == 'sticker') {
                transportation_stickers = ['665073523504168', '210852145739487', '209575122566323', '210852145739487', '567099163388580'];
                msg = {sticker: transportation_stickers[Math.floor(Math.random() * transportation_stickers.length)]};

                api.sendMessage(msg, message.threadID);
            } else if (type == 'share') {
                position_url = message.attachments[0].facebookUrl;

                pattern = /where1=(.*)%2C\+(.*)&FORM/;
                position = pattern.exec(position_url);

                users_position[message.senderID] = [position[1], position[2]];

                api.sendMessage('OK, now I got you. :)', message.threadID);
            } else {
                api.sendMessage('I don\'t want to be straight, but... you look so sorry. :P', message.threadID);
            }
        } else {
            if (message.body.match(/news/i)) {
                //news
            } else if (message.body.match(/live/i)) {
                //live info
            } else if (message.body.match(/nearest/i)) {
                //nearest stop
            } else if (message.body.match()) {
                //route
            } else if (message.body.match(/bored/i)) {
                //easter eggs
            }
        }
    });
});

@@ -35,16 +35,54 @@
 -api');%0A
+var rnv_api = require('rnv_api.js');%0A%0A
 var user
@@ -106,16 +106,41 @@
 Array();
+%0Avar rnv = new rnv_api();
 %0A%0Alogin(
@@ -1340,14 +1340,31 @@
     
-//
 news
+ = rnv.get_news();%0A
 %0A   
@@ -1434,19 +1434,43 @@
     
-//
 live
- info
+_infos = rnv.get_live_infos();%0A
 %0A   
@@ -1543,93 +1543,635 @@
     
-//nearest stop%0A            %7D else if (message.body.match()) %7B%0A                //route
+if (users_position%5Bmessage.senderID%5D) %7B%0A                    nearest_stop = rnv.get_the_nearest_stop(users_position%5Bmessage.senderID%5D);%0A%0A                %7D else %7B%0A                    api.sendMessage('Sorry, but did you share your location with me?', message.threadID);%0A                %7D%0A            %7D else if (message.body.match()) %7B%0A                if (users_position%5Bmessage.senderID%5D) %7B%0A                    route = rnv.get_route(users_position%5Bmessage.senderID%5D, destination);%0A%0A                %7D else %7B%0A                    api.sendMessage('Sorry, but did you share your location with me?', message.threadID);%0A                %7D
 %0A   

Add prototypes