Guest User

wbcreateclaim

a guest
Mar 23rd, 2015
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var api = new mw.Api();
  2. api.get({
  3.   action:'query',
  4.   continue:'',
  5.   meta:'tokens',
  6.   format:'json'
  7. }).done(function(token) {
  8.   api.post({
  9.     action: 'wbcreateclaim',
  10.     entity: 'Q4115189',
  11.     property: 'P901',
  12.     snaktype: 'value',
  13.     token: token.query.tokens.csrftoken,
  14.     value: {'entity-type': "item", 'numeric-id':1}
  15.   }).done(function(data) {
  16.     console.log(data);
  17.   });
  18. });
Advertisement
Add Comment
Please, Sign In to add comment