panchira 1.3.4 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c708ae7d488bb68419b16ba734bca6e31c023913104453373269168780781f1
4
- data.tar.gz: 7ed26206ae6a2c87c662dfef7f2b9817232142bbdb474160150f25348d8f5fc6
3
+ metadata.gz: 45b393a405624e26e8d6555c1833e0f65e5e93deef13518197ec4b15fc3bff61
4
+ data.tar.gz: b770975cbbba8d66cf6acde417ae9d32e78d310f145726ff16b60824a49f99e3
5
5
  SHA512:
6
- metadata.gz: 5576bf4e990a86737e2f8a520c619a1028c4fa32d2f372e35e21e3a0ae914ebfdff03fc5ffcbe29d85c4332dfe2223b56af71a97065b365c575ae3ad97b24abb
7
- data.tar.gz: 28b1c641f95a3cff9097032d4695d1eda1b9f759c4bc598778e6949bf63cf3d711a7526b5736ed7391fe17d30e71517676f6c7ae4a076375c917ed7d3f2afa8e
6
+ metadata.gz: 9c4ca217b6bd3fa782fa92d36ed1a1974880e2ff1746319cbd4f3e652d947807f74490b937a7f84cd4b1c8c46b0a95bd91a8374c28d575aa224c3c9ce6817385
7
+ data.tar.gz: b050fcb7586b81209e0d2f0ac521ab34c4db0ad05362655b3b25ae16c2d226a31b57da50019a195bb092080cfddf5eb1bdf44c80757f3943b1075860182b3add
data/CHANGELOG.md CHANGED
@@ -4,13 +4,20 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## 1.3.5 - 2021-09-01
8
+ ### Added
9
+ - Added support for Pixiv Novel.
10
+
11
+ ### Fixed
12
+ - Fixed an issue where Image Resolver missed image scales.
13
+
7
14
  ## 1.3.4 - 2021-07-26
8
15
  ### Fixed
9
16
  - Fixed an issue where Iwara Resolver failed when a description was present.
10
17
 
11
18
  ## 1.3.3 - 2021-07-25
12
19
  ### Added
13
- - Added Support for Iwara.
20
+ - Added support for Iwara.
14
21
 
15
22
  ### Fixed
16
23
  - Fixed an issue where DLsite Resolver was retrieving wrong tags.
@@ -90,6 +97,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
90
97
  ### Added
91
98
  - Released Panchira gem. At this time we can parse only 5 websites.
92
99
 
100
+ [1.3.5]: https://github.com/nuita/panchira/releases/tag/v1.3.5
101
+ [1.3.4]: https://github.com/nuita/panchira/releases/tag/v1.3.4
102
+ [1.3.3]: https://github.com/nuita/panchira/releases/tag/v1.3.3
93
103
  [1.3.2]: https://github.com/nuita/panchira/releases/tag/v1.3.2
94
104
  [1.3.1]: https://github.com/nuita/panchira/releases/tag/v1.3.1
95
105
  [1.3.0]: https://github.com/nuita/panchira/releases/tag/v1.3.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- panchira (1.3.4)
4
+ panchira (1.3.5)
5
5
  fastimage (~> 2.1.7)
6
6
  nokogiri (>= 1.10.9, < 1.12.0)
7
7
 
@@ -9,6 +9,8 @@ module Panchira
9
9
  result.canonical_url = @url
10
10
  result.image = PanchiraImage.new
11
11
  result.image.url = @url
12
+ result.image.width, result.image.height = FastImage.size(result.image.url)
13
+
12
14
  result.resolver = parse_resolver
13
15
  result
14
16
  end
@@ -44,5 +44,32 @@ module Panchira
44
44
  end
45
45
  end
46
46
 
47
+ class PixivNovelResolver < Resolver
48
+ URL_REGEXP = %r{pixiv\.net/novel/show.php\?id=(\d+)}.freeze
49
+
50
+ def initialize(url)
51
+ super(url)
52
+ @novel_id = url.slice(URL_REGEXP, 1)
53
+
54
+ raw_json = URI.parse("https://www.pixiv.net/ajax/novel/#{@novel_id}").read('User-Agent' => user_agent)
55
+ @json = JSON.parse(raw_json)
56
+ end
57
+
58
+ private
59
+
60
+ def parse_title
61
+ @json['body']['title']
62
+ end
63
+
64
+ def parse_author
65
+ @json['body']['userName']
66
+ end
67
+
68
+ def parse_tags
69
+ @json['body']['tags']['tags'].map { |content| content['tag'] }
70
+ end
71
+ end
72
+
47
73
  ::Panchira::Extensions.register(Panchira::PixivResolver)
74
+ ::Panchira::Extensions.register(Panchira::PixivNovelResolver)
48
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Panchira
4
- VERSION = '1.3.4'
4
+ VERSION = '1.3.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panchira
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-26 00:00:00.000000000 Z
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler