Skip to content

Instantly share code, notes, and snippets.

@renanccastro
Created May 9, 2016 21:43
Show Gist options
  • Save renanccastro/44dcd14419f4d6192b00f146c5b23547 to your computer and use it in GitHub Desktop.
Save renanccastro/44dcd14419f4d6192b00f146c5b23547 to your computer and use it in GitHub Desktop.
ida = new Array();
pontos = new Array();
volta = new Array();
codigo = new Array();
$ = cheerio.load(data);
parseJavascriptAndSave($('script').contents().text(), codigo_linha, iterador);
function parseJavascriptAndSave(script, codigo_linha, iterador){
//descarta o window, pois não tem no node(server-side)
var window = new Object();
eval(script);
initialize();
}
function maps(){
this.MapTypeId = new MapTypeId();
this.Map = function(a){
};
this.event = new event();
this.Polyline = function(a){
return new polyline(a);
}
this.Marker = function(a){
b = new marker(a);
return b;
};
this.LatLng = function (lat, lng){
b = new latlang(lat, lng);
return b;
}
}
function google(){
this.maps = new maps();
}
function MapTypeId(){
this.ROADMAP = 1;
}
function document(){
this.getElementById = function (a){
}
}
function polyline(a){
this.a = a;
if(ida_used){
ida = a.path;
}
else{
volta = a.path;
ida_used = 1;
}
this.setMap = function(b){
};
}
function marker(b){
this.b = b;
pontos.push(b.position);
this.setMap = function(c){
};
}
function event(){
this.addListener = function(a, b, c){
this.a = a;
this.b = b;
this.c = c;
}
}
function latlang(lat, lng){
this.lat = lat;
this.lng = lng;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment