const p = new Promise(function(resolve, reject) {
for (let event of lastGame) {
let itemId = event.id
if (event.home.name === "Sporting CP Women") {
getDetailedHistory(itemId, allHomeEvent)
}
if (event.away.name === "Sporting CP Women") {
getDetailedHistoryReverse(itemId, allHomeEvent)
}
}
resolve();
})
function test () {
console.log(allHomeEvent)
}
p.then(() => {
test();
})
[ { home_score: '4', away_score: '6' },
{ home_score: '4', away_score: '6' } ]
[ { home_score: '3', away_score: '6' },
{ home_score: '2', away_score: '6' } ]
[ { home_score: '6', away_score: '1' },
{ home_score: '6', away_score: '0' } ]
[ { home_score: '6', away_score: '3' },
{ home_score: '6', away_score: '1' } ]
[ { home_score: '6', away_score: '3' },
{ home_score: '5', away_score: '7' },
{ home_score: '6', away_score: '4' } ]
[ { home_score: '6', away_score: '2' },
{ home_score: '7', away_score: '5' } ]
[ { home_score: '6', away_score: '3' },
{ home_score: '3', away_score: '6' },
{ home_score: '4', away_score: '6' } ]
[ { home_score: '4', away_score: '6' },
{ home_score: '6', away_score: '3' },
{ home_score: '6', away_score: '2' } ]
[ { home_score: '6', away_score: '4' },
{ home_score: '5', away_score: '7' },
{ home_score: '6', away_score: '1' } ]
var needle = require('needle');
var cheerio = require('cheerio');
needle.get('https://whoer.net/ru', { proxy: '199.21.99.205:80' }, function(error, response) {
if (!error && response.statusCode == 200) {
if (response.body) {
var $ = cheerio.load(response.body);
$('strong.your-ip').each(function() {
console.log($(this).text());
});
}
} else {
console.log('Error!!!');
}
});