ficon 0.0.6 → 0.0.7

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: d19c583939eb6e0c4394ae8bbc34a4abc934c66f
4
- data.tar.gz: 31336a3ff07a98c954507ff08fd7e1f15f9060b5
3
+ metadata.gz: 0f448ec75fb5d9873e7ceb037778d157b7ca05fe
4
+ data.tar.gz: e9e35f677407bfba88e236d1c395585d1f3576de
5
5
  SHA512:
6
- metadata.gz: 76753e3597385f4cb593db03fdb916ba2d481c2c5a4fbc7c4d509ce25c8e7aca5f2bf9f46850b5370bcb9f25b3ea9db86c077ed3d7245a60f16f2b06f93c6057
7
- data.tar.gz: d8466e2b46a4c301b48db31eb1457749e5cb1e1992a3b48290cfc021d9fe9b62796b9b81d1fc3df4110e831ab1b200e0f8eac09b6accc3cbb5c1b22a64f3ef6f
6
+ metadata.gz: eacbc439f9a3dd4c1bce7ebed05446ef3a9b5539d9831d5b745f7346f6b79353399860f1631f17efe8ec2ce1a567c3b00c76231ddaf712c2c4a0efefd122c009
7
+ data.tar.gz: 46186733e3a604e5ab78030af4a8b01c6f909cc2e3aba194be286ac9304fe9e4114b81abe4de86f114c236f51525ad9ba41221ed2a50ef264b82e76c18009e1e
data/README.md CHANGED
@@ -18,8 +18,12 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- irb(main)> Ficon.from_uri "https://facebook.com"
22
- => ["https://www.facebook.com/images/fb_icon_325x325.png", "https://fbstatic-a.akamaihd.net/rsrc.php/yV/r/hzMapiNYYpW.ico", "https://www.facebook.com/favicon.ico"]
21
+ irb(main)> Ficon::Site.new('https://booko.info/9780748109999').site_icons.first.url
22
+ => "https://booko.info/favicon-196x196.png"
23
+
24
+ irb(main):008:0> Ficon::Site.new('https://booko.info/9780748109999').page_images.first.url
25
+ => "https://covers.booko.com.au/9780748109999.jpg"
26
+
23
27
 
24
28
  Or form the shell:
25
29
 
@@ -55,6 +55,7 @@ module Ficon
55
55
  @site.images = Site.site_images(@uri, doc)||[]
56
56
  @site.page_images = Site.page_images(@uri, doc)||[]
57
57
  other_page_data
58
+ return
58
59
  end
59
60
 
60
61
  def report
@@ -75,6 +76,14 @@ module Ficon
75
76
  @site.page_images
76
77
  end
77
78
 
79
+ def title
80
+ @site.title
81
+ end
82
+
83
+ def description
84
+ @site.description
85
+ end
86
+
78
87
  def other_page_data
79
88
  @site.title = doc.at_xpath("//meta[@property='og:title']/@content")&.value || @doc.at_xpath("//title")&.text&.strip
80
89
  @site.description = doc.at_xpath("//meta[@property='og:description']/@content")&.value
@@ -82,6 +91,10 @@ module Ficon
82
91
  @site.canonical = canonical unless canonical == @url
83
92
  end
84
93
 
94
+ def to_s
95
+ @url
96
+ end
97
+
85
98
  def self.site_images(uri, doc, site=nil)
86
99
  results = []
87
100
 
@@ -1,3 +1,3 @@
1
1
  module Ficon
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ficon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Milne