Created
May 27, 2015 13:07
-
-
Save AdamEsterle/2f18beccf0b6ad1aba47 to your computer and use it in GitHub Desktop.
AT&T
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = []; | |
var dollars = []; | |
jQuery.get( "https://www.att.com/olam/billUsageTiles.myworld", function( mbData ) { | |
jQuery(mbData).find('a[title="Web Usage"]').each(function(i) { | |
data.push(parseFloat(jQuery(this).find('span > strong').text().trim()) * 1024); | |
}); | |
jQuery.get( "https://www.att.com/olam/billOverviewTiles.myworld", function( dollarData ) { | |
jQuery(dollarData).find('span.flipper.float-right.font14.top10px.padRight20.colorBlack').not('.ie7Top7').each(function(i) { | |
dollars.push(jQuery(this).text().trim()); | |
}); | |
console.log(data); | |
console.log(dollars); | |
}); | |
return combineDollarsAndData(dollars, data); | |
}); | |
function combineDollarsAndData(dollars, data){ | |
// Expected format | |
// dollars["Adam"] = 65 | |
// data["Adam"] = 4500 | |
var combined = {}; | |
for (var i in dollars) { | |
combined{dollars[i]} = data[i] | |
}; | |
return combined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment