jekyll-webmention_io 3.3.6 → 3.3.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92d94de0add9cc4571ce7b0f312cce727c3b387e645101f8c190e025c58be261
|
4
|
+
data.tar.gz: 8dbd9f8960c7c5c427c861fc08bc368a901e04b51267219fc1030b81b33b25e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 676aa2fd229c06d44f077f3eb7fb7f52deec8bad2f082b101fffb6379b66f35e90a1fcfe31d06539f4baeb77f6a5f7712aa5319d09c463fe5d2cf2c02e34974d
|
7
|
+
data.tar.gz: f73660974098440e3b658183dd9a9a10817d8fc010db197766e80678d43e4e295341adef6e057eee33c5acc5b06b1f3ce38f1bd1cbbad776199c64a95129147f
|
@@ -39,15 +39,19 @@ module Jekyll
|
|
39
39
|
target = "http:#{target}"
|
40
40
|
end
|
41
41
|
|
42
|
+
# produce an escaped version of the target (in case of special
|
43
|
+
# characters, etc).
|
44
|
+
escaped = URI::Parser.new.escape(target);
|
45
|
+
|
42
46
|
# skip bad URLs
|
43
|
-
next unless WebmentionIO.uri_ok?(
|
47
|
+
next unless WebmentionIO.uri_ok?(escaped)
|
44
48
|
|
45
49
|
# get the endpoint
|
46
|
-
endpoint = WebmentionIO.get_webmention_endpoint(
|
50
|
+
endpoint = WebmentionIO.get_webmention_endpoint(escaped)
|
47
51
|
next unless endpoint
|
48
52
|
|
49
53
|
# get the response
|
50
|
-
response = WebmentionIO.webmention(source, target
|
54
|
+
response = WebmentionIO.webmention(source, target)
|
51
55
|
next unless response
|
52
56
|
|
53
57
|
# capture JSON responses in case site wants to do anything with them
|
@@ -72,7 +72,7 @@ module Jekyll
|
|
72
72
|
if post.data["in_reply_to"]
|
73
73
|
uris[post.data["in_reply_to"]] = false
|
74
74
|
end
|
75
|
-
post.content.scan(/(?:https?:)?\/\/[^\s)#\[\]{}<>%|\^"]+/) do |match|
|
75
|
+
post.content.scan(/(?:https?:)?\/\/[^\s)#\[\]{}<>%|\^"']+/) do |match|
|
76
76
|
unless uris.key? match
|
77
77
|
uris[match] = false
|
78
78
|
end
|
data/lib/jekyll/webmention_io.rb
CHANGED
@@ -16,6 +16,7 @@ require "net/http"
|
|
16
16
|
require "uri"
|
17
17
|
require "openssl"
|
18
18
|
require "string_inflection"
|
19
|
+
require "indieweb/endpoints"
|
19
20
|
require "webmention"
|
20
21
|
|
21
22
|
module Jekyll
|
@@ -209,7 +210,7 @@ module Jekyll
|
|
209
210
|
def self.get_webmention_endpoint(uri)
|
210
211
|
# log "info", "Looking for webmention endpoint at #{uri}"
|
211
212
|
begin
|
212
|
-
endpoint =
|
213
|
+
endpoint = IndieWeb::Endpoints.get(uri)[:webmention]
|
213
214
|
unless endpoint
|
214
215
|
log("info", "Could not find a webmention endpoint at #{uri}")
|
215
216
|
uri_is_not_ok(uri)
|
@@ -222,16 +223,17 @@ module Jekyll
|
|
222
223
|
endpoint
|
223
224
|
end
|
224
225
|
|
225
|
-
def self.webmention(source, target
|
226
|
+
def self.webmention(source, target)
|
226
227
|
log "info", "Sending webmention of #{target} in #{source}"
|
227
228
|
# return `curl -s -i -d \"source=#{source}&target=#{target}\" -o /dev/null #{endpoint}`
|
228
|
-
|
229
|
-
|
230
|
-
|
229
|
+
response = Webmention.send_webmention(source, target)
|
230
|
+
|
231
|
+
case response.code
|
232
|
+
when 200, 201, 202
|
231
233
|
log "info", "Webmention successful!"
|
232
|
-
|
234
|
+
response.body
|
233
235
|
else
|
234
|
-
log "info",
|
236
|
+
log "info", response.inspect
|
235
237
|
log "info", "Webmention failed, but will remain queued for next time"
|
236
238
|
false
|
237
239
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-webmention_io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Gustafson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: openssl
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '2.0'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '4.0'
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - "
|
61
|
+
- - ">="
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '2.0'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '4.0'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: string_inflection
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,14 +112,14 @@ dependencies:
|
|
106
112
|
requirements:
|
107
113
|
- - "~>"
|
108
114
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0
|
115
|
+
version: '7.0'
|
110
116
|
type: :runtime
|
111
117
|
prerelease: false
|
112
118
|
version_requirements: !ruby/object:Gem::Requirement
|
113
119
|
requirements:
|
114
120
|
- - "~>"
|
115
121
|
- !ruby/object:Gem::Version
|
116
|
-
version: 0
|
122
|
+
version: '7.0'
|
117
123
|
- !ruby/object:Gem::Dependency
|
118
124
|
name: bundler
|
119
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -276,7 +282,7 @@ homepage: https://github.com/aarongustafson/jekyll-webmention_io
|
|
276
282
|
licenses:
|
277
283
|
- MIT
|
278
284
|
metadata: {}
|
279
|
-
post_install_message:
|
285
|
+
post_install_message:
|
280
286
|
rdoc_options: []
|
281
287
|
require_paths:
|
282
288
|
- lib
|
@@ -291,8 +297,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
297
|
- !ruby/object:Gem::Version
|
292
298
|
version: '0'
|
293
299
|
requirements: []
|
294
|
-
rubygems_version: 3.
|
295
|
-
signing_key:
|
300
|
+
rubygems_version: 3.3.3
|
301
|
+
signing_key:
|
296
302
|
specification_version: 4
|
297
303
|
summary: A Jekyll plugin for sending & receiving webmentions via Webmention.io.
|
298
304
|
test_files: []
|