bin/duckgo in duckgo-1.2.0 vs bin/duckgo in duckgo-1.2.1

- old
+ new

@@ -21,10 +21,15 @@ duckgo [--help | -h] : Display this help duckgo [--version | -V] : Display version duckgo [--favicon | -f] google.com : Get google's favicon duckgo \\!gem duckgo : Use !bang syntax to search a specific site +If you do not see an answer, please shorten the search string. +e.g. 'something with tons of extra information' => 'something' +This is an aspect of DuckGo I can control, because the official API does not +allow a full search. More information - https://duckduckgo.com/api + View docs and API on https://github.com/wlib/duckgo Made by Daniel Ethridge | git.io/de """ # Argument "parser" if you want to call it that @@ -41,9 +46,19 @@ favicon = get_favicon(site) file.write(favicon) puts "Queried favicon from #{site}." file.close exit + when "--infobox", "-i" + data = get_data(ARGV[1..-1].join(" ")) + extras_data = find_extras(data) + if extras_data["Infobox"] + puts extract_infobox(data).to_yaml + exit + else + puts "No infobox retrieved, try more clear search keywords or remove 'the --infobox|-i flag'" + exit + end else handle(ARGV[0..-1].join(" ")) exit end \ No newline at end of file