From f2e64b06887aa2c01266429d589e0473fe3741c9 Mon Sep 17 00:00:00 2001 From: hahwul Date: Mon, 15 Aug 2022 23:26:04 +0900 Subject: [PATCH] Update script --- scripts/migration.rb | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/scripts/migration.rb b/scripts/migration.rb index cfb6aba..0e2ad24 100644 --- a/scripts/migration.rb +++ b/scripts/migration.rb @@ -16,6 +16,30 @@ def get_os install return lst end +def get_browser str + lst = [] + if str.include? 'Chrome' + lst.push 'chrome' + end + if str.include? 'Firefox' + lst.push 'firefox' + end + if str.include? 'Safari' + lst.push 'safari' + end + if str.include? 'Burp' + lst.push 'burpsuite' + end + if str.include? 'ZAP' + lst.push 'zap' + end + if str.include? 'All' + lst.push 'burpsuite' + lst.push 'zap' + end + return lst +end + def get_urls str return URI.extract(str).uniq end @@ -34,7 +58,12 @@ def migrate jsonfile, category new_obj['category'] = category new_obj['types'] = [] if obj['Install'] != nil - new_obj['os'] = get_os(obj['Install']) + new_obj['platform'] = get_os(obj['Install']) + end + if category.include? 'addon' + if obj['Type'].length > 0 + new_obj['platform'] = get_browser(obj['Type']) + end end new_obj['lang'] = [] # parse DATA new_obj['tags'] = []