duckgo 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/duckgo +13 -4
- data/de.surge.sh-favicon.ico +0 -0
- data/due.s-favicon.ico +0 -0
- data/lib/duckgo.rb +4 -2
- data/lib/duckgo/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db9f873a22d18a71f87ef838a110ecb668304e04
|
4
|
+
data.tar.gz: 5be7c578227e2dacb4f623e43a0f1e3f350b21fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e53046fc36a7723941ed1fe8b67073e57069b9a773cdcd7bf0257dbca68fef1e4ffe564a9c279e22706311cc082904202996abe4fcb4036c29f02c4c099748bc
|
7
|
+
data.tar.gz: 8a6cd711c2a08d2214ba2f9d650a538c80eeae8aae631abd84f7b9c35d8f02ece6ec02a43087aa1bff40403abba17f5911cf564f03373869439c18e5c33e0588
|
data/bin/duckgo
CHANGED
@@ -17,10 +17,11 @@ end
|
|
17
17
|
|
18
18
|
help = """DuckGo lets you search duckduckgo.com for instant answers
|
19
19
|
|
20
|
-
duckgo
|
21
|
-
duckgo [--
|
22
|
-
duckgo
|
23
|
-
duckgo
|
20
|
+
duckgo something searchable : Auto-handle the search
|
21
|
+
duckgo [--help | -h] : Display this help
|
22
|
+
duckgo [--version | -V] : Display version
|
23
|
+
duckgo [--favicon | -f] google.com : Get google's favicon
|
24
|
+
duckgo \\!gem duckgo : Use !bang syntax to search a specific site
|
24
25
|
|
25
26
|
View docs and API on https://github.com/wlib/duckgo
|
26
27
|
Made by Daniel Ethridge | git.io/de
|
@@ -34,6 +35,14 @@ case ARGV[0]
|
|
34
35
|
when "--version", "-V"
|
35
36
|
puts "DuckGo v#{VERSION}"
|
36
37
|
exit
|
38
|
+
when "--favicon", "-f"
|
39
|
+
site = ARGV[1]
|
40
|
+
file = File.open("#{site}-favicon.ico", "w")
|
41
|
+
favicon = get_favicon(site)
|
42
|
+
file.write(favicon)
|
43
|
+
puts "Queried favicon from #{site}."
|
44
|
+
file.close
|
45
|
+
exit
|
37
46
|
else
|
38
47
|
handle(ARGV[0..-1].join(" "))
|
39
48
|
exit
|
File without changes
|
data/due.s-favicon.ico
ADDED
File without changes
|
data/lib/duckgo.rb
CHANGED
@@ -47,8 +47,10 @@ module DuckGo
|
|
47
47
|
# Get a website/page's favicon through duckduckgo's proxy
|
48
48
|
def get_favicon(page)
|
49
49
|
favicon = get(nil, "/i/#{page}.ico")
|
50
|
-
|
51
|
-
|
50
|
+
require 'digest'
|
51
|
+
generic_resp = "ad4b0f606e0f8465bc4c4c170b37e1a3"
|
52
|
+
if Digest::MD5.hexdigest(favicon) == generic_resp
|
53
|
+
puts "Warning: response is 200-OK, but content is a generic response\nThis probably means the favicon is unreachable"
|
52
54
|
return nil
|
53
55
|
else
|
54
56
|
return favicon
|
data/lib/duckgo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duckgo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Ethridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -54,9 +54,11 @@ files:
|
|
54
54
|
- Rakefile
|
55
55
|
- bin/duckgo
|
56
56
|
- bin/setup
|
57
|
+
- de.surge.sh-favicon.ico
|
57
58
|
- docs/README.md
|
58
59
|
- docs/getting_data.md
|
59
60
|
- duckgo.gemspec
|
61
|
+
- due.s-favicon.ico
|
60
62
|
- lib/duckgo.rb
|
61
63
|
- lib/duckgo/version.rb
|
62
64
|
homepage: https://github.com/wlib/duckgo
|