ficon 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/lib/ficon.rb +13 -0
- data/lib/ficon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f448ec75fb5d9873e7ceb037778d157b7ca05fe
|
4
|
+
data.tar.gz: e9e35f677407bfba88e236d1c395585d1f3576de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
22
|
-
=>
|
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
|
|
data/lib/ficon.rb
CHANGED
@@ -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
|
|
data/lib/ficon/version.rb
CHANGED