Created
February 11, 2022 12:11
-
-
Save andgineer/ae8b7869d6682eb6bb4fba9549d28935 to your computer and use it in GitHub Desktop.
Alfred dictionary: Create Blank workflow, add inputs/Script filter, language Ruby, with input as {query}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
dictionary_list = [ | |
{"Яндекс переводчик": "https://translate.yandex.ru/?lang=en-ru&text={query}"}, | |
{"Oxford Dictionary": "https://www.oxfordlearnersdictionaries.com/definition/english/{query}?q={query}"}, | |
{"Cambridge Dictionary": "https://dictionary.cambridge.org/dictionary/english-russian/{query}"} | |
] | |
script_filter_items = [] | |
dictionary_list.each do |hash| | |
hash.each do |k, v| | |
script_filter_items.push(title: k, quicklookurl: v) | |
end | |
end | |
puts({ items: script_filter_items }.to_json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment