Skip to content

Instantly share code, notes, and snippets.

@pe3
Created May 22, 2017 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pe3/8e560d892327016b4a9cc0ec7e2c443c to your computer and use it in GitHub Desktop.
Save pe3/8e560d892327016b4a9cc0ec7e2c443c to your computer and use it in GitHub Desktop.
Programmatically writing to Wikidata
const config = {
// Required
username: 'personal-wikidata-username',
password: 'password',
// Optional
verbose: true // Default: false
}
const wdEdit = require('wikidata-edit')(config)
// writing to one of the three sandbox nodes available for testing
// https://www.wikidata.org/wiki/Q4115189
// https://www.wikidata.org/wiki/Q13406268
// https://www.wikidata.org/wiki/Q15397819
wdEdit.label.set('Q4115189', 'fi', 'Mitäs ihmettä!?')
{
"name": "t",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"wikidata-edit": "https://github.com/pe3/wikidata-edit"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment