Answer the question
In order to leave comments, you need to log in
How to decode a string?
Hello.
I want to parse information from the site myscore.ru, namely to get the matches for tomorrow:
SA÷1¬~ZA÷АВСТРАЛИЯ: Женская высшая лига¬ZEE÷tbR6H4dE¬ZB÷24¬ZY÷Австралия¬ZC÷KMpoB4mr¬ZD÷c¬ZE÷radPIsO6¬ZF÷0¬ZO÷0¬ZG÷1¬ZH÷24_tbR6H4dE¬ZJ÷2¬ZL÷/football/australia/w-league/¬ZX÷00А
Answer the question
In order to leave comments, you need to log in
Judging from the code of the page, nothing needs to be decrypted. Creators pass a multidimensional array in this way. Here is the part of the code responsible for parsing the string:
var FeedParser = (function() {
function FeedParser(Feed_Table_StatsParser) {
this.DELIMITER_ROW = "~";
this.DELIMITER_CELL = "¬";
this.DELIMITER_VALUE = "÷";
this.statsParser = Feed_Table_StatsParser
}
FeedParser.prototype.parse = function(feed) {
var statsParser = this.statsParser;
statsParser.startFeed();
var rows = feed.split(this.DELIMITER_ROW);
for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
var row = rows_1[_i];
statsParser.startRow();
var cells = row.split(this.DELIMITER_CELL);
for (var _a = 0, cells_1 = cells; _a < cells_1.length; _a++) {
var cell = cells_1[_a];
var keyValue = cell.split(this.DELIMITER_VALUE);
statsParser.parse(keyValue[0], keyValue[1])
}
statsParser.endRow()
}
statsParser.endFeed();
return statsParser.getParsedModel()
};
return FeedParser
}());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question