Created
February 14, 2018 08:24
-
-
Save hrj/62fae20c99ad07bfc2480ce2e47a9bf1 to your computer and use it in GitHub Desktop.
Filter and sort results from AppBrain
This file contains hidden or 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 searchTerm = $ARG[0] | |
var auth = JSON.parse(readFully('appBrain.json')) | |
var query = encodeURIComponent(searchTerm) | |
print("searching for", searchTerm, query) | |
var command = "curl -o queryResult.json https://api.appbrain.com/v1/info/search?di=${auth.DI}&t=${auth.TOKEN}&query=${query}&sort=RELEVANCY&filter=FREE&limit=50" | |
print("command", command) | |
$EXEC(command) | |
var result = JSON.parse(readFully('queryResult.json')) | |
var apps = result.data.apps | |
apps.sort(function (a1, a2) { return a1.permissions.length - a2.permissions.length}) | |
for (i in apps) { | |
var app = apps[i] | |
print(app.name) | |
print(" permissions:" , app.permissions.length, "Play store URL: ", 'https://play.google.com/store/apps/details?id=' + app.package) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment