-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlaceVersions.js
34 lines (29 loc) · 925 Bytes
/
PlaceVersions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Update the placeId here
// Go to http://api.roblox.com/docs
// Paste this script into the console
var placeId = 1818; // put your placeId here
function getPage(placeId, pageNumber, callback) {
var url = "https://api.roblox.com/assets/" + placeId + "/versions?page=" + pageNumber;
$.ajax({
url: url,
method: "GET",
dataType: "json",
success: function(results) {
callback(results);
}
});
}
function getAllPages(placeId, pageNumber) {
getPage(placeId, pageNumber, function(results) {
for (var i = 0; i<results.length; i++) {
var version = results[i];
var downloadUrl = "https://roblox.com/asset/?assetVersionId="+version.Id;
var date = new Date(version.Created).toISOString().substring(0, 10);
console.log("V" + version.VersionNumber + " (" + date + ")" + ": " + downloadUrl);
}
if (results.length > 0) {
getAllPages(placeId, pageNumber + 1);
}
});
}
getAllPages(placeId, 1);