Skip to content

Instantly share code, notes, and snippets.

@CaptSolo
Last active August 29, 2017 20:28
Show Gist options
  • Save CaptSolo/99d74a1d84708d3b099e5d0006abba9c to your computer and use it in GitHub Desktop.
Save CaptSolo/99d74a1d84708d3b099e5d0006abba9c to your computer and use it in GitHub Desktop.
Retrieve AppStore app information (command line)
#!/usr/bin/env node
var util = require('util');
var store = require('app-store-scraper');
function print_usage() {
console.log(util.format("\nUsage: %s app_store_id\n\nPrints information about the AppStore application with the given ID.\n", process.argv[1]));
}
function get_app_data(appId) {
return store.app({id: appId}).then(function (result) {
return [result.title, result.requiredOsVersion, result.requiredOsVersion.split(".")[0]];
})
}
if (process.argv.length < 3) {
print_usage();
process.exit(1);
}
// retrieve app information from the AppStore
appId = process.argv[2];
get_app_data(appId).then(function(data) {
console.log(data.join("\t"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment