
// Use Parse.Cloud.define to define as many cloud functions as you want.
// For example:
Parse.Cloud.define("hello", function(request, response) {
  response.success("Hello world!");
});

@@ -1,12 +1,4 @@
-%0A// Use 
 Pars
@@ -9,169 +9,543 @@
 oud.
-define to define as many cloud functions as you want.%0A// For example:%0AParse.Cloud.define(%22hello%22, function(request, response) %7B%0A  response.success(%22Hello world!%22
+useMasterKey();%0A%0AParse.Cloud.job(%22removeUnusedUrbanAirship%22, function(request, status) %7B%0A    var UA_INSTALLED = %22uaInstalled%22;%0A    var UA_OPT_IN = %22uaOptIn%22;%0A    var query = new Parse.Query(Parse.Installation);%0A    query.equalTo(UA_INSTALLED, false)%0A        .equalTo(UA_OPT_IN, false);%0A    var count = 0;%0A%0A    query.each(function(install) %7B%0A        count++;%0A        install.destroy();%0A    %7D).then(function() %7B%0A        status.success(count + %22 Urban Airship entries removed%22);%0A    %7D, function(error) %7B%0A        status.error(error);%0A    %7D
 );%0A%7D

remove Urban Airship entries that are already uninstalled or opted out.