Skip to content

Instantly share code, notes, and snippets.

@andgineer
Created February 11, 2022 12:11
Show Gist options
  • Save andgineer/ae8b7869d6682eb6bb4fba9549d28935 to your computer and use it in GitHub Desktop.
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}
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