mirror of
https://github.com/hahwul/WebHackersWeapons.git
synced 2024-12-18 12:14:22 -05:00
Update migrate script
This commit is contained in:
parent
de533b951c
commit
3d2390e48b
@ -20,28 +20,35 @@ def get_urls str
|
|||||||
return URI.extract(str).uniq
|
return URI.extract(str).uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
file = File.read('./data.json')
|
def migrate jsonfile
|
||||||
data_hash = JSON.parse(file)
|
file = File.read(jsonfile)
|
||||||
|
data_hash = JSON.parse(file)
|
||||||
|
|
||||||
data_hash.each do | name, obj |
|
data_hash.each do | name, obj |
|
||||||
filename = name.gsub(' ','_')+".yaml"
|
filename = name.gsub(' ','_')+".yaml"
|
||||||
# Make object
|
# Make object
|
||||||
new_obj = {}
|
new_obj = {}
|
||||||
new_obj['name'] = name
|
new_obj['name'] = name
|
||||||
new_obj['description'] = obj['Description']
|
new_obj['description'] = obj['Description']
|
||||||
new_obj['urls'] = get_urls obj['Data']
|
new_obj['urls'] = get_urls obj['Data']
|
||||||
new_obj['category'] = 'tool'
|
new_obj['category'] = 'tool'
|
||||||
new_obj['types'] = []
|
new_obj['types'] = []
|
||||||
if obj['Install'] != nil
|
if obj['Install'] != nil
|
||||||
new_obj['os'] = get_os(obj['Install'])
|
new_obj['os'] = get_os(obj['Install'])
|
||||||
|
end
|
||||||
|
new_obj['lang'] = [] # parse DATA
|
||||||
|
new_obj['tags'] = []
|
||||||
|
|
||||||
|
# Convert to YAML
|
||||||
|
yaml_data = YAML.dump(new_obj)
|
||||||
|
|
||||||
|
# Save yaml file
|
||||||
|
puts filename
|
||||||
|
#File.write("./data/#{filename}", yaml_data)
|
||||||
end
|
end
|
||||||
new_obj['lang'] = [] # parse DATA
|
|
||||||
new_obj['tags'] = []
|
|
||||||
|
|
||||||
# Convert to YAML
|
|
||||||
yaml_data = YAML.dump(new_obj)
|
|
||||||
|
|
||||||
# Save yaml file
|
|
||||||
puts filename
|
|
||||||
#File.write("./data/#{filename}", yaml_data)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
migrate './data.json'
|
||||||
|
migrate './Bookmarklets/data.json'
|
||||||
|
migrate './Browser Extensions/data.json'
|
||||||
|
migrate './Burp and ZAP Extensions/data.json'
|
Loading…
Reference in New Issue
Block a user