Commit abcb607f authored by Dorian Krefft's avatar Dorian Krefft

Updated the communication with the JetBrains API (searching for plugins).

parent cf73e792
Pipeline #88389912 passed with stage
in 1 minute and 50 seconds
......@@ -43,15 +43,15 @@ module IntelliJ
def suggest_plugin(name, edition)
product = product_edition_code(edition)
response = request_json_response("https://plugins.jetbrains.com/search/suggest?product=#{product}&term=#{name}")
response = request_json_response("https://plugins.jetbrains.com/api/searchSuggest?isIDERequest=false&product=#{product}&term=#{name}")
result = {}
response.each do |suggestion|
name = suggestion['value']
id = suggestion['data']['url'].match(/\/plugin\/(\d+)-.*/)[1]
id = suggestion['url'].match(/\/plugin\/(\d+)-.*/)[1]
result[name] = {}
result[name]['id'] = id
result[name]['name'] = name
result[name]['family'] = suggestion['data']['target']
result[name]['family'] = suggestion['target']
end
result
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment