metainspector 4.2.1 → 4.3.0
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 +7 -8
- data/lib/meta_inspector/document.rb +5 -0
- data/lib/meta_inspector/version.rb +1 -1
- data/spec/document_spec.rb +5 -0
- 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: 522b262bf637695bc4a4803c6001fd9c5407363a
|
|
4
|
+
data.tar.gz: 11607a5a8a63de10d4ad74bf6b49a14e65d83139
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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
|
-
|
|
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
|
|
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,
|
data/spec/document_spec.rb
CHANGED
|
@@ -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/",
|