Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env python
- # -*- coding: utf-8 -*-
- import json
- import urllib.request
- with open('av.txt', 'w') as output:
- data = urllib.request.urlopen('https://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2?callback=Request.JSONP.request_map.request_0').read()
- output.write(str(data)[38:-3])
- with open('av.txt') as input:
- data = input.read()
- availability = json.loads(data)['answer']['availability']
- for item in availability:
- if item['reference'] == '142sk1':
- for zone in item['zones']:
- print(zone['zone'], zone['availability'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement