mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
22 lines
567 B
Python
Executable File
22 lines
567 B
Python
Executable File
#!/usr/bin/env python
|
|
from lxml import html
|
|
import requests
|
|
import json
|
|
|
|
page = requests.get('https://docs.atlassian.com/jira/REST/cloud')
|
|
tree = html.fromstring(page.content)
|
|
|
|
schemas = tree.xpath("//div[@class='representation-doc-block']//code/text()")
|
|
|
|
for schema in schemas:
|
|
try:
|
|
data = json.loads(schema)
|
|
if "title" in data:
|
|
title = data["title"].replace(" ", "")
|
|
print "Writing {}.json".format(title)
|
|
with open("{}.json".format(title), 'w') as f:
|
|
f.write(schema)
|
|
except:
|
|
True
|
|
|