User talk:Hooray/Sandbox/MP

From FlightGear wiki
Jump to navigation Jump to search

Code

var url= "http://wiki.flightgear.org/User:Hooray/Sandbox/MP";
var begin = '[LIST]';
var end = '[/LIST]';

http.load(url)
    .done(func(r) {
var article = r.response;
var  beginPos = find(begin, article);
var  endPos = find(end, article);

#print("begin:", beginPos);
#print("end:", endPos);

var rawList = substr(article, beginPos+size(begin) , endPos-beginPos-size(end) );
#print("list:", rawList );

csvList = split(',',rawList);

foreach(var line; csvList) {
 var (callsign, url) = split('=', line);
 print("callsign:",callsign, " url:", url);
}

}); # end of done() callback