metainspector 4.2.1 → 4.3.0

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: bd4bfdcaa225ae095a22dc7d853daa2046e5c764
4
- data.tar.gz: 6d7588c9732ea0a4f2e6512c92aff721874197e6
3
+ metadata.gz: 522b262bf637695bc4a4803c6001fd9c5407363a
4
+ data.tar.gz: 11607a5a8a63de10d4ad74bf6b49a14e65d83139
5
5
  SHA512:
6
- metadata.gz: 85974aa0874dfd9e2f90c97416ceac9c9512ce4919cc8f90a2e74078d388d5e0d214db16ef13958975d110760ef88ff861cd16d0e8a654bcc00df142fa2616b9
7
- data.tar.gz: 0274b0b000bc61fd88f08090c2ede9bed40055f7f351c522991e73289585a1948fedd4bd158a1cf07749cd6d31c8dccaac051903a684f7c341a3004471c830a8
6
+ metadata.gz: 333e9453fc03ff78a0ad3428f1251b0ed3a4e0753f9a1b6299fffea59ff4ba79b97ac38b0903e8ddd09a24a5fd3f03bc4ae06fdc1ea30e90bf752c72f844ab57
7
+ data.tar.gz: a5b3ae17b9abb9bee136af342185e711e83869eea779f935cd42b47805528c9a5a5fdba51529bdf345b5e03de8ad35ac69ef4105be73b4e0bb0d5ed4ac30f5ca
data/README.md CHANGED
@@ -8,14 +8,12 @@ You give it an URL, and it lets you easily get its title, links, images, charset
8
8
 
9
9
  You can try MetaInspector live at this little demo: [https://metainspectordemo.herokuapp.com](https://metainspectordemo.herokuapp.com)
10
10
 
11
- ## Changes in 4.2.1
11
+ ## Changes in 4.3
12
12
 
13
- * The Document API has been extended with one new method:
13
+ * The Document API has been extended with one new method `page.best_title` that returns the longest text available from a selection of candidates.
14
+ * `to_hash` now includes `scheme`, `host`, `root_url`, `best_title` and `description`.
14
15
 
15
- * `page.best_title` returns the longest text available from a selection of candidates.
16
-
17
-
18
- ## Changes in 4.2.0
16
+ ## Changes in 4.2
19
17
 
20
18
  * The images API has been extended, with two new methods:
21
19
 
@@ -24,7 +22,7 @@ You can try MetaInspector live at this little demo: [https://metainspectordemo.h
24
22
 
25
23
  * The criteria for `page.images.best` has changed slightly, we'll now return the largest image instead of the first image if no owner-suggested image is found.
26
24
 
27
- ## Changes in 4.1.0
25
+ ## Changes in 4.1
28
26
 
29
27
  * Introduces the `:normalize_url` option, which allows to disable URL normalization.
30
28
 
@@ -110,7 +108,8 @@ page.url # URL of the page
110
108
  page.scheme # Scheme of the page (http, https)
111
109
  page.host # Hostname of the page (like, sitevalidator.com, without the scheme)
112
110
  page.root_url # Root url (scheme + host, like http://sitevalidator.com/)
113
- page.title # title of the page, as string
111
+ page.title # title of the page from the head section, as string
112
+ page.best_title # best title of the page, from a selection of candidates
114
113
  page.links.raw # every link found, unprocessed
115
114
  page.links.all # every link found on the page as an absolute URL
116
115
  page.links.http # every HTTP link found
@@ -57,7 +57,12 @@ module MetaInspector
57
57
  def to_hash
58
58
  {
59
59
  'url' => url,
60
+ 'scheme' => scheme,
61
+ 'host' => host,
62
+ 'root_url' => root_url,
60
63
  'title' => title,
64
+ 'best_title' => best_title,
65
+ 'description' => description,
61
66
  'links' => links.to_hash,
62
67
  'images' => images.to_a,
63
68
  'charset' => charset,
@@ -1,3 +1,3 @@
1
1
  module MetaInspector
2
- VERSION = "4.2.1"
2
+ VERSION = "4.3.0"
3
3
  end
@@ -21,7 +21,12 @@ describe MetaInspector::Document do
21
21
  doc = MetaInspector::Document.new('http://pagerankalert.com')
22
22
  doc.to_hash.should == {
23
23
  "url" => "http://pagerankalert.com/",
24
+ "scheme" => "http",
25
+ "host" => "pagerankalert.com",
26
+ "root_url" => "http://pagerankalert.com/",
24
27
  "title" => "PageRankAlert.com :: Track your PageRank changes & receive alerts",
28
+ "best_title" => "PageRankAlert.com :: Track your PageRank changes & receive alerts",
29
+ "description" => "Track your PageRank(TM) changes and receive alerts by email",
25
30
  "favicon" => "http://pagerankalert.com/src/favicon.ico",
26
31
  "links" => {
27
32
  'internal' => ["http://pagerankalert.com/",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metainspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Iniesta