jekyll-pinboard 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-pinboard.rb +16 -9
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41f25456c6d1ed55c3b529b26aab9af66aacbb4e
4
- data.tar.gz: 8d699fe4654abc2636d73a69ec1bec61bc010d60
3
+ metadata.gz: 02da2c3f4ce65eb7ddc7e9bc227efebbc3ef9d20
4
+ data.tar.gz: 77045658399045ea1897ac2f603ea83155d9fa85
5
5
  SHA512:
6
- metadata.gz: 2aabac9751b7d6976463bd8d386ff00d8e9ca14cbe7544fe5ffcb23adf88c2a2851bdc11f2c24ab537e22014acbc6ebc994b46f7cf048ac5477070ec835556bf
7
- data.tar.gz: 77e4968d65ffa57d4d0a592da6c0283ba258574a7d22943326f3c14b82c484fce8599d339f185de9f1dc1034f3ec9d8df2b94d9d8fec84dd8bf49fc046b21fbb
6
+ metadata.gz: ed2923093a644e6be75e80bfefbdac97232a1d3812ee752d872d4684f387470fe0935175f8ee0cc68090111d2cd9e0f9752e3254d416099f5154245f3c16d7ff
7
+ data.tar.gz: b9ad49c3c2f8f3e758a401560a18063926698c9085f278d3044a37e08751ed98a2eaa1635ee58fbc0228e76586939f9e04b9ba9ab69d5ccc9add7fffdd2fb84f
@@ -9,15 +9,22 @@ Jekyll::Hooks.register :site, :after_init do |site|
9
9
  pinboard_token = site.config['pinboard']['token']
10
10
  pinboard_tags = site.config['pinboard']['tags']
11
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
12
+ site.config['pinboard']['posts'] = {}
13
+ site.config['pinboard']['posts']['tags'] = {}
14
+
15
+ # retrieve all the book marks
16
+ all_posts = JSON.parse(open("https://api.pinboard.in/v1/posts/all?auth_token=" + pinboard_token + "&format=json").read)
17
+ site.config['pinboard']['posts']['all'] = all_posts
18
+
19
+ # go through all of bookmarks and organize by tag
20
+ all_posts.each_with_index do |post, key|
21
+ tags = post['tags'].split(' ')
22
+ tags.each do |tag|
23
+ if (site.config['pinboard']['posts']['tags'].include? tag)
24
+ site.config['pinboard']['posts']['tags'][tag].push(post)
25
+ else
26
+ site.config['pinboard']['posts']['tags'][tag] = [post]
27
+ end
20
28
  end
21
-
22
29
  end
23
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Mandis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2016-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 2.6.7
69
+ rubygems_version: 2.4.8
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: A Jekyll plugin that makes your Pinboard bookmarks accessible