feedjira-youtube 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +61 -0
- data/LICENSE.txt +21 -0
- data/README.md +25 -0
- data/Rakefile +6 -0
- data/feedjira-youtube.gemspec +22 -0
- data/lib/feedjira/youtube.rb +8 -0
- data/lib/feedjira/youtube/entry_parser.rb +24 -0
- data/lib/feedjira/youtube/feed_parser.rb +8 -0
- data/lib/feedjira/youtube/version.rb +5 -0
- metadata +69 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 032dcb20a31454586fc6af22492b23b57ebba82d1140a6049be657a25b4fbed3
|
4
|
+
data.tar.gz: 5b244147e32d186716dddc888177d4b920c80d0f7eb61e930935c7b2046fcfff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c6c9b5877b611847462937c084c5ac527287d74b62da88c66a5898cb73fb320636697904ad175fb09378149a7bf7a07b2a71aec22b5f55ec775664f17a912068
|
7
|
+
data.tar.gz: 7f20ee46b0013f8fc0808e647a7e0564592e7b048b8c7a3965b43b61242eac26afc5aa8812f7091beff1ba16d6a7121d9affedd526bde2835f74f72dfc8f11e8
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
feedjira-youtube (0.1.0)
|
5
|
+
feedjira
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
awesome_print (1.8.0)
|
11
|
+
coderay (1.1.2)
|
12
|
+
crass (1.0.4)
|
13
|
+
diff-lcs (1.3)
|
14
|
+
faraday (0.15.4)
|
15
|
+
multipart-post (>= 1.2, < 3)
|
16
|
+
faraday_middleware (0.13.1)
|
17
|
+
faraday (>= 0.7.4, < 1.0)
|
18
|
+
feedjira (2.2.0)
|
19
|
+
faraday (>= 0.9)
|
20
|
+
faraday_middleware (>= 0.9)
|
21
|
+
loofah (>= 2.0)
|
22
|
+
sax-machine (>= 1.0)
|
23
|
+
loofah (2.2.3)
|
24
|
+
crass (~> 1.0.2)
|
25
|
+
nokogiri (>= 1.5.9)
|
26
|
+
method_source (0.9.2)
|
27
|
+
mini_portile2 (2.4.0)
|
28
|
+
multipart-post (2.0.0)
|
29
|
+
nokogiri (1.10.1)
|
30
|
+
mini_portile2 (~> 2.4.0)
|
31
|
+
pry (0.12.2)
|
32
|
+
coderay (~> 1.1.0)
|
33
|
+
method_source (~> 0.9.0)
|
34
|
+
rake (12.3.2)
|
35
|
+
rspec (3.8.0)
|
36
|
+
rspec-core (~> 3.8.0)
|
37
|
+
rspec-expectations (~> 3.8.0)
|
38
|
+
rspec-mocks (~> 3.8.0)
|
39
|
+
rspec-core (3.8.0)
|
40
|
+
rspec-support (~> 3.8.0)
|
41
|
+
rspec-expectations (3.8.2)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.8.0)
|
44
|
+
rspec-mocks (3.8.0)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.8.0)
|
47
|
+
rspec-support (3.8.0)
|
48
|
+
sax-machine (1.3.2)
|
49
|
+
|
50
|
+
PLATFORMS
|
51
|
+
ruby
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
awesome_print
|
55
|
+
feedjira-youtube!
|
56
|
+
pry
|
57
|
+
rake
|
58
|
+
rspec
|
59
|
+
|
60
|
+
BUNDLED WITH
|
61
|
+
1.17.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Benoit MARTIN-CHAVE
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Feedjira::Youtube
|
2
|
+
|
3
|
+
Alternative Youtube parser for [Feedjira](https://github.com/feedjira/feedjira).
|
4
|
+
|
5
|
+
Differences with the original parser :
|
6
|
+
|
7
|
+
- it add `<br>` tags to `#summary`
|
8
|
+
- it add `<br>` tags to `#content`
|
9
|
+
- it add player to `#content`
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem "feedjira-youtube"
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Just add the gem to your Gemfile.
|
22
|
+
|
23
|
+
## License
|
24
|
+
|
25
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "feedjira/youtube/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "feedjira-youtube"
|
7
|
+
spec.version = Feedjira::Youtube::VERSION
|
8
|
+
spec.authors = ["Benoit MARTIN-CHAVE"]
|
9
|
+
spec.email = ["benoit@martin-chave.ch"]
|
10
|
+
|
11
|
+
spec.summary = "Alternative Youtube parser for Feedjira."
|
12
|
+
spec.homepage = "https://github.com/BenoitMC/feedjira-youtube"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = Dir.chdir(__dir__) do
|
16
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
end
|
18
|
+
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "feedjira"
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Feedjira
|
2
|
+
module Youtube
|
3
|
+
class EntryParser < Parser::AtomYoutubeEntry
|
4
|
+
sax_config.top_level_elements.delete("media:description")
|
5
|
+
sax_config.top_level_elements.delete("summary")
|
6
|
+
|
7
|
+
element :"media:description", as: :summary
|
8
|
+
|
9
|
+
def summary
|
10
|
+
super
|
11
|
+
.delete("\r")
|
12
|
+
.gsub("\n", "<br/>\n")
|
13
|
+
end
|
14
|
+
|
15
|
+
def content
|
16
|
+
%(#{player_html}<br/><br/>#{summary})
|
17
|
+
end
|
18
|
+
|
19
|
+
def player_html
|
20
|
+
%(<iframe width="600" height="375" src="https://www.youtube.com/embed/#{youtube_video_id}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: feedjira-youtube
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Benoit MARTIN-CHAVE
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: feedjira
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description:
|
28
|
+
email:
|
29
|
+
- benoit@martin-chave.ch
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".rspec"
|
36
|
+
- Gemfile
|
37
|
+
- Gemfile.lock
|
38
|
+
- LICENSE.txt
|
39
|
+
- README.md
|
40
|
+
- Rakefile
|
41
|
+
- feedjira-youtube.gemspec
|
42
|
+
- lib/feedjira/youtube.rb
|
43
|
+
- lib/feedjira/youtube/entry_parser.rb
|
44
|
+
- lib/feedjira/youtube/feed_parser.rb
|
45
|
+
- lib/feedjira/youtube/version.rb
|
46
|
+
homepage: https://github.com/BenoitMC/feedjira-youtube
|
47
|
+
licenses:
|
48
|
+
- MIT
|
49
|
+
metadata: {}
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubygems_version: 3.0.1
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Alternative Youtube parser for Feedjira.
|
69
|
+
test_files: []
|