youtube_to_rss 0.2 → 0.3.4

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: 85780af5e3663fc1e12a9f3763c939f2614d20f7c846d205393c273b54d34a13
4
- data.tar.gz: 32a28f4f02375fed666cba38107eda4ccde1642559ff4b33a7d75f2c9faa0bde
3
+ metadata.gz: 60fd78a73f53895e371a44e52fc53c85f324367c4747a016a88a6cc0fb40185f
4
+ data.tar.gz: 8644a437705985033e4d71a9ed89f8acffa0ef1445cd2607ba29873d2176eebb
5
5
  SHA512:
6
- metadata.gz: e5ee729a77c4b846404aa1dbe6e60fb26e695daa1bd9eb817ec0ec567329381768b4a5f83a142bf2d9eea58ee2ddb2a584006ec8a8355ae09a0b46d594898954
7
- data.tar.gz: ad121bb08dd1aa9920a4bb7d17ed356bf0d5f841c6e648690ca8178fb79d41c4059b5a2474e9a35f9841e362da63a7a01c86ee0a33083a109b7574481ebd11db
6
+ metadata.gz: 1c2402941edad47eaa89a9392581312328f5c496bbcd666b5dd29f20969d5612ccd76bc212254e5a50274a3ec555f552a91ea4494170faed8b6fd59e6e6e0749
7
+ data.tar.gz: c022eb930698aac3f624ee15e8f73b61fcef3a6352cc07899b1253968559c7adcd9aa0ae776a352a9a96b40d8330cda6b31e3fee3ebd0a0b85311cab5dadd020
data/Gemfile CHANGED
@@ -5,12 +5,3 @@ gemspec
5
5
 
6
6
  gem "rake", "~> 12.0"
7
7
  gem "rspec", "~> 3.0"
8
-
9
- group :development, :test do
10
- gem 'rubocop'
11
- gem 'pry'
12
- gem 'pry-doc'
13
- gem 'pry-rails'
14
- gem 'spring-commands-rspec'
15
- gem 'rspec-rails'
16
- end
data/Gemfile.lock CHANGED
@@ -1,76 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- youtube_to_rss (0.1.1)
4
+ youtube_to_rss (0.3.4)
5
+ httparty
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
- actionpack (6.1.0)
10
- actionview (= 6.1.0)
11
- activesupport (= 6.1.0)
12
- rack (~> 2.0, >= 2.0.9)
13
- rack-test (>= 0.6.3)
14
- rails-dom-testing (~> 2.0)
15
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
16
- actionview (6.1.0)
17
- activesupport (= 6.1.0)
18
- builder (~> 3.1)
19
- erubi (~> 1.4)
20
- rails-dom-testing (~> 2.0)
21
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
- activesupport (6.1.0)
23
- concurrent-ruby (~> 1.0, >= 1.0.2)
24
- i18n (>= 1.6, < 2)
25
- minitest (>= 5.1)
26
- tzinfo (~> 2.0)
27
- zeitwerk (~> 2.3)
28
- ast (2.4.1)
29
- builder (3.2.4)
30
- coderay (1.1.3)
31
- concurrent-ruby (1.1.7)
32
- crass (1.0.6)
33
10
  diff-lcs (1.4.4)
34
- erubi (1.10.0)
35
- i18n (1.8.5)
36
- concurrent-ruby (~> 1.0)
37
- loofah (2.8.0)
38
- crass (~> 1.0.2)
39
- nokogiri (>= 1.5.9)
40
- method_source (1.0.0)
41
- mini_portile2 (2.4.0)
42
- minitest (5.14.2)
43
- nokogiri (1.10.10)
44
- mini_portile2 (~> 2.4.0)
45
- parallel (1.20.1)
46
- parser (2.7.2.0)
47
- ast (~> 2.4.1)
48
- pry (0.13.1)
49
- coderay (~> 1.1)
50
- method_source (~> 1.0)
51
- pry-doc (1.1.0)
52
- pry (~> 0.11)
53
- yard (~> 0.9.11)
54
- pry-rails (0.3.9)
55
- pry (>= 0.10.4)
56
- rack (2.2.3)
57
- rack-test (1.1.0)
58
- rack (>= 1.0, < 3)
59
- rails-dom-testing (2.0.3)
60
- activesupport (>= 4.2.0)
61
- nokogiri (>= 1.6)
62
- rails-html-sanitizer (1.3.0)
63
- loofah (~> 2.3)
64
- railties (6.1.0)
65
- actionpack (= 6.1.0)
66
- activesupport (= 6.1.0)
67
- method_source
68
- rake (>= 0.8.7)
69
- thor (~> 1.0)
70
- rainbow (3.0.0)
11
+ httparty (0.21.0)
12
+ mini_mime (>= 1.0.0)
13
+ multi_xml (>= 0.5.2)
14
+ mini_mime (1.1.2)
15
+ multi_xml (0.6.0)
71
16
  rake (12.3.3)
72
- regexp_parser (2.0.0)
73
- rexml (3.2.4)
74
17
  rspec (3.10.0)
75
18
  rspec-core (~> 3.10.0)
76
19
  rspec-expectations (~> 3.10.0)
@@ -83,49 +26,14 @@ GEM
83
26
  rspec-mocks (3.10.0)
84
27
  diff-lcs (>= 1.2.0, < 2.0)
85
28
  rspec-support (~> 3.10.0)
86
- rspec-rails (4.0.1)
87
- actionpack (>= 4.2)
88
- activesupport (>= 4.2)
89
- railties (>= 4.2)
90
- rspec-core (~> 3.9)
91
- rspec-expectations (~> 3.9)
92
- rspec-mocks (~> 3.9)
93
- rspec-support (~> 3.9)
94
29
  rspec-support (3.10.0)
95
- rubocop (1.6.1)
96
- parallel (~> 1.10)
97
- parser (>= 2.7.1.5)
98
- rainbow (>= 2.2.2, < 4.0)
99
- regexp_parser (>= 1.8, < 3.0)
100
- rexml
101
- rubocop-ast (>= 1.2.0, < 2.0)
102
- ruby-progressbar (~> 1.7)
103
- unicode-display_width (>= 1.4.0, < 2.0)
104
- rubocop-ast (1.3.0)
105
- parser (>= 2.7.1.5)
106
- ruby-progressbar (1.10.1)
107
- spring (2.1.1)
108
- spring-commands-rspec (1.0.4)
109
- spring (>= 0.9.1)
110
- thor (1.0.1)
111
- tzinfo (2.0.3)
112
- concurrent-ruby (~> 1.0)
113
- unicode-display_width (1.7.0)
114
- yard (0.9.25)
115
- zeitwerk (2.4.2)
116
30
 
117
31
  PLATFORMS
118
32
  ruby
119
33
 
120
34
  DEPENDENCIES
121
- pry
122
- pry-doc
123
- pry-rails
124
35
  rake (~> 12.0)
125
36
  rspec (~> 3.0)
126
- rspec-rails
127
- rubocop
128
- spring-commands-rspec
129
37
  youtube_to_rss!
130
38
 
131
39
  BUNDLED WITH
@@ -1,3 +1,3 @@
1
1
  module YoutubeToRss
2
- VERSION = "0.2"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -1,32 +1,22 @@
1
1
  require 'youtube_to_rss/version'
2
+ require 'httparty'
2
3
 
3
4
  module YoutubeToRss
4
- class Error < StandardError; end
5
+ include HTTParty
5
6
 
6
7
  class << self
7
8
  def convert(url)
8
- url = remove_query_strings(url)
9
- base_url = 'https://www.youtube.com/feeds/videos.xml?'
10
-
11
- if url.include?('/channel/')
12
- "#{base_url}channel_id=#{extract_param(url, '/channel/')}"
13
- elsif url.include?('/c/')
14
- "#{base_url}channel_id=#{extract_param(url, '/c/')}"
15
- elsif url.include?('/user/')
16
- "#{base_url}user=#{extract_param(url, '/user/')}"
17
- else
18
- raise 'URL should have "channel" or "c" or "user" param.'
19
- end
9
+ retrieve_rss_url(get_parsed_response(url))
20
10
  end
21
11
 
22
12
  private
23
13
 
24
- def extract_param(url, param)
25
- url.split(param).last
14
+ def get_parsed_response(url)
15
+ get(url).parsed_response
26
16
  end
27
17
 
28
- def remove_query_strings(url)
29
- url.split('?').first.split('&').first
18
+ def retrieve_rss_url(parsed_response)
19
+ parsed_response.split('"rssUrl":"').last.split('",').first
30
20
  end
31
21
  end
32
22
  end
@@ -15,6 +15,8 @@ Gem::Specification.new do |spec|
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = "https://github.com/ccozkan/youtube_to_rss"
17
17
 
18
+ spec.add_dependency "httparty"
19
+
18
20
  # Specify which files should be added to the gem when it is released.
19
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
22
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youtube_to_rss
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - C Çağrı Özkan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
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'
13
27
  description: ''
14
28
  email:
15
29
  - ccozkan@gmail.com