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 +4 -4
- data/CHANGELOG.md +11 -1
- data/Gemfile.lock +1 -1
- data/lib/panchira/resolvers/image_resolver.rb +2 -0
- data/lib/panchira/resolvers/pixiv_resolver.rb +27 -0
- data/lib/panchira/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45b393a405624e26e8d6555c1833e0f65e5e93deef13518197ec4b15fc3bff61
|
|
4
|
+
data.tar.gz: b770975cbbba8d66cf6acde417ae9d32e78d310f145726ff16b60824a49f99e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
@@ -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
|
data/lib/panchira/version.rb
CHANGED
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
|
+
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-
|
|
11
|
+
date: 2021-09-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|