Created
October 23, 2015 04:52
-
-
Save jooyunghan/3b69c18c08339781ce18 to your computer and use it in GitHub Desktop.
Get last-minute changes from Confluece
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
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