favico 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b1a6d70a1e060feda07d9d2e4b36fc884379c0a
4
- data.tar.gz: 941d2b5a40a0f18101ae90b0fce4bfe6489df1e6
3
+ metadata.gz: 69045da5e817e08dbc1801b47d31e9d2f2475851
4
+ data.tar.gz: c0b8a2823f510ea2c04311130f322c8cbc5f387e
5
5
  SHA512:
6
- metadata.gz: 933d66a4e57d97c4603f203e37e1e65599e8a75c0fdf98a80f7701f876b7e233542945a562eab396523ac33a16a245eeea1b1cd392b16ff92dc51c60f64b7aea
7
- data.tar.gz: 506ac046622b11476d27a48cafd318f44d8042521e0661e185087dce3d71a4e53705058eee584b375efeee7f745866fbda2533cfb905d25dd2c1192d8390d752
6
+ metadata.gz: e4f49a3a80efa7fedca644786a240a81e0bbde3d4d2c2919b92fe7510e44c66d9a47e00c6b9e6ef9d05c13577cf0366ab0958df2b99cdaf03ee06f280757ab5e
7
+ data.tar.gz: 3e6b1fba68c8cfe788746fc87c50c679b465b8b2ec7dd9ce693bf358e9cbbfef746c55601919b9b81da12458d93f72737efac1202d36518c041b8565629dc968
data/README.md CHANGED
@@ -3,8 +3,10 @@ with a fairly simple interface. Mostly created because I was slightly bored.
3
3
 
4
4
  ```
5
5
  fparser = Favicon::Parser.new
6
- fparser.fetch_favicon("http://www.google.com")
6
+ fparser.fetch_favicon_url("http://www.google.com")
7
7
  => "http://www.google.com/favicon.ico"
8
+ fparser.fetch_favicon("http://www.google.com")
9
+ => "<raw binary for favicon>"
8
10
  ```
9
11
 
10
12
  That's about it. It'll be useful for creating your own favicon fetcher or something
@@ -12,6 +12,15 @@ module Favico
12
12
  end
13
13
 
14
14
  def fetch_favicon(url)
15
+ favicon_url = fetch_favicon_url(url)
16
+ response = self.class.get(favicon_url)
17
+ if not response.nil? && response.code == 200
18
+ return response.body
19
+ end
20
+ nil
21
+ end
22
+
23
+ def fetch_favicon_url(url)
15
24
  if root_favicon?(url)
16
25
  return url + "/favicon.ico"
17
26
  end
@@ -1,3 +1,3 @@
1
1
  module Favico
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: favico
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bunting