Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2015 18:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
__author__ = 'Sebastian Burgstaller'
from PBB_login import WDLogin
import requests
import json
import pprint
user = ''
pwd = ''
# login = WD_Login(user=user, password=pwd)
login_obj = WDLogin(user=user, pwd=pwd, server='')
cookies = login_obj.get_edit_cookie()
edit_token = login_obj.get_edit_token()
query = ''
token = edit_token
data = '{"claims":[{"id": "Q1232$CE803569-5434-4D0B-8A80-E0F04C345FB9","remove": ""}]}'
headers = {'content-type': 'application/x-www-form-urlencoded'}
payload = {'action': 'wbeditentity',
'id': 'Q1232',
'data': data,
'format': 'json',
'token': token}
# reply = json.load(urllib2.urlopen(query))
reply =, headers=headers, data=payload, cookies=cookies)
json_data = json.loads(reply.text)
except requests.HTTPError as e:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment