jekyll-pinboard 0.1.1 → 0.2.5

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.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/jekyll-pinboard.rb +17 -12
  3. metadata +23 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 41f25456c6d1ed55c3b529b26aab9af66aacbb4e
4
- data.tar.gz: 8d699fe4654abc2636d73a69ec1bec61bc010d60
2
+ SHA256:
3
+ metadata.gz: d9a18ea0de98afa9f4b9659373b2a506ce134f91e1f74be3f80c80a3cd4cc22f
4
+ data.tar.gz: 8780bd6d2873ddf2233b7aff8fab7e18a342e28b93a8cc0daca30363c58a781b
5
5
  SHA512:
6
- metadata.gz: 2aabac9751b7d6976463bd8d386ff00d8e9ca14cbe7544fe5ffcb23adf88c2a2851bdc11f2c24ab537e22014acbc6ebc994b46f7cf048ac5477070ec835556bf
7
- data.tar.gz: 77e4968d65ffa57d4d0a592da6c0283ba258574a7d22943326f3c14b82c484fce8599d339f185de9f1dc1034f3ec9d8df2b94d9d8fec84dd8bf49fc046b21fbb
6
+ metadata.gz: c4046d2ee46c389e7720c5dd1a1f9e3b8b43cc3907b95576a54457749ba8bfba53626237cc449e329ae0353c998d28db7f8454119988fa4dac27f47bf45122ba
7
+ data.tar.gz: de51a00aebf7902fb06390cc49bba34e6fadf2638c6c5cd8112b83ea7cd45afcc4e38ef7d9b48dd4904c281e1ec00e4df131e54f3981c74af703899c1ac3693a
@@ -1,23 +1,28 @@
1
1
  # Jekyll Pinboard Plugin
2
2
  # https://github.com/snaptortoise/jekyll-pinboard-plugin
3
- # Author: George Mandis (http://george.mandi.is, https://snaptortoise.com)
3
+ # Author: George Mandis (http://george.mand.is, https://snaptortoise.com)
4
4
 
5
5
  require "open-uri"
6
6
  require "json"
7
7
 
8
8
  Jekyll::Hooks.register :site, :after_init do |site|
9
9
  pinboard_token = site.config['pinboard']['token']
10
- pinboard_tags = site.config['pinboard']['tags']
11
- site.config['pinboard']['data'] = {}
12
-
13
- pinboard_tags.each_with_index do |tag, key|
14
- json_data = open("https://api.pinboard.in/v1/posts/all?auth_token=" + pinboard_token + "&format=json&tag=" + tag).read
15
-
16
- begin
17
- site.config['pinboard']['data'][tag] = JSON.parse(json_data)
18
- rescue
19
- puts "Pinboard might be down. There was an error parsing JSON from: " + "https://api.pinboard.in/v1/posts/all?auth_token=" + pinboard_token + "&format=json&tag=" + tag
10
+ site.config['pinboard']['posts'] = {}
11
+ site.config['pinboard']['posts']['tags'] = {}
12
+
13
+ # retrieve all the book marks
14
+ all_posts = JSON.parse(URI.open("https://api.pinboard.in/v1/posts/all?auth_token=" + pinboard_token + "&format=json").read)
15
+ site.config['pinboard']['posts']['all'] = all_posts
16
+
17
+ # go through all of bookmarks and organize by tag
18
+ all_posts.each_with_index do |post, key|
19
+ tags = post['tags'].split(' ')
20
+ tags.each do |tag|
21
+ if (site.config['pinboard']['posts']['tags'].include? tag)
22
+ site.config['pinboard']['posts']['tags'][tag].push(post)
23
+ else
24
+ site.config['pinboard']['posts']['tags'][tag] = [post]
25
+ end
20
26
  end
21
-
22
27
  end
23
28
  end
metadata CHANGED
@@ -1,43 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-pinboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Mandis
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.6'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '2.0'
22
+ version: 3.6.3
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.6'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '2.0'
32
+ version: 3.6.3
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: json
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
37
+ - - "~>"
32
38
  - !ruby/object:Gem::Version
33
39
  version: '2.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.0.1
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
- - - ">="
47
+ - - "~>"
39
48
  - !ruby/object:Gem::Version
40
49
  version: '2.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 2.0.1
41
53
  description: This plugin makes your Pinboard bookmarks accessible within your Jekyll
42
54
  templates.
43
55
  email: george@mand.is
@@ -50,7 +62,7 @@ homepage: https://github.com/snaptortoise/jekyll-pinboard-plugin
50
62
  licenses:
51
63
  - MIT
52
64
  metadata: {}
53
- post_install_message:
65
+ post_install_message:
54
66
  rdoc_options: []
55
67
  require_paths:
56
68
  - lib
@@ -65,9 +77,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
77
  - !ruby/object:Gem::Version
66
78
  version: '0'
67
79
  requirements: []
68
- rubyforge_project:
69
- rubygems_version: 2.6.7
70
- signing_key:
80
+ rubyforge_project:
81
+ rubygems_version: 2.7.8
82
+ signing_key:
71
83
  specification_version: 4
72
84
  summary: A Jekyll plugin that makes your Pinboard bookmarks accessible
73
85
  test_files: []