webmention 0.1.0 → 0.1.1
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.
- data/README.md +2 -2
- data/lib/webmention/client.rb +6 -6
- data/lib/webmention/version.rb +1 -1
- data/test/data/sample_html.rb +9 -0
- metadata +1 -2
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Webmention Client
|
|
3
3
|
|
4
4
|
A Ruby gem for sending [webmention](http://indiewebcamp.com/webmention) (and [pingback](http://indiewebcamp.com/pingback)) notifications.
|
5
5
|
|
6
|
-
[](https://travis-ci.org/indieweb/mention-client-ruby)
|
7
7
|
|
8
8
|
Installation
|
9
9
|
------------
|
@@ -46,7 +46,7 @@ end
|
|
46
46
|
Webmention
|
47
47
|
----------
|
48
48
|
|
49
|
-
To learn more about Webmention, see [webmention.org](http://webmention.org).
|
49
|
+
To learn more about Webmention, see [webmention.org](http://webmention.org) and [indiewebcamp.com/webmention](http://indiewebcamp.com/webmention).
|
50
50
|
|
51
51
|
|
52
52
|
License
|
data/lib/webmention/client.rb
CHANGED
@@ -130,12 +130,12 @@ module Webmention
|
|
130
130
|
|
131
131
|
def self.discover_webmention_endpoint_from_html html
|
132
132
|
doc = Nokogiri::HTML(html)
|
133
|
-
if !doc.css('
|
134
|
-
doc.css('
|
135
|
-
elsif !doc.css('
|
136
|
-
doc.css('
|
137
|
-
elsif !doc.css('
|
138
|
-
doc.css('
|
133
|
+
if !doc.css('[rel="webmention"]').empty?
|
134
|
+
doc.css('[rel="webmention"]').attribute("href").value
|
135
|
+
elsif !doc.css('[rel="http://webmention.org/"]').empty?
|
136
|
+
doc.css('[rel="http://webmention.org/"]').attribute("href").value
|
137
|
+
elsif !doc.css('[rel="http://webmention.org"]').empty?
|
138
|
+
doc.css('[rel="http://webmention.org"]').attribute("href").value
|
139
139
|
else
|
140
140
|
false
|
141
141
|
end
|
data/lib/webmention/version.rb
CHANGED
data/test/data/sample_html.rb
CHANGED
@@ -10,6 +10,15 @@ class SampleData
|
|
10
10
|
eos
|
11
11
|
end
|
12
12
|
|
13
|
+
def self.rel_webmention_a_href
|
14
|
+
<<-eos
|
15
|
+
<html>
|
16
|
+
<head>
|
17
|
+
<a rel="webmention" href="http://webmention.io/example/webmention">webmention</a>
|
18
|
+
</head>
|
19
|
+
</html>
|
20
|
+
eos
|
21
|
+
end
|
13
22
|
def self.rel_href_webmention
|
14
23
|
<<-eos
|
15
24
|
<html>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmention
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -163,4 +163,3 @@ test_files:
|
|
163
163
|
- test/lib/webmention/url_test.rb
|
164
164
|
- test/lib/webmention/version_test.rb
|
165
165
|
- test/test_helper.rb
|
166
|
-
has_rdoc:
|