Skip to content

Instantly share code, notes, and snippets.

@jooyunghan
Created October 23, 2015 04:52
Show Gist options
  • Save jooyunghan/3b69c18c08339781ce18 to your computer and use it in GitHub Desktop.
Save jooyunghan/3b69c18c08339781ce18 to your computer and use it in GitHub Desktop.
Get last-minute changes from Confluece
class Confluence {
constructor(base, username, password) {
this.base = base;
this.username = username;
this.password = password;
}
async getChanges() {
let results = [];
let url = this.base + '/rest/api/content/search?cql=lastModified>now("-1m")';
try {
while (true) {
var body = await getJson(url, this.username, this.password);
results.push(...body.results);
if (body._links.next === undefined) break;
url = body._links.base + body._links.next;
}
} catch (err) {
console.error(err);
}
return results;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment