youtube_parser 0.1.0 → 0.1.1

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: a9f07597f46f3a960b11c08eae61b02e11c270c23b4ff2c3c56cc2ee09aba4c3
4
- data.tar.gz: b274a8867a72688c69bbe1b9b4ec46a82e107be24b9201f56d6f69fbfa117170
3
+ metadata.gz: 2787d7682c42086c3586dd86a774760b0ee78f314ab297cc06e669cd1c5b8167
4
+ data.tar.gz: 537a9cdf529e9b5760661aa75188bfc0990d82402de42776f9ebd6786394bc8c
5
5
  SHA512:
6
- metadata.gz: b91bc4d8b8d39e1bbeffd081224d7806c9d7de2bafb54f561b495b2e119a74037de5c57107248face916aa863a82a8d939b57432e3b98adc620edce8904dcb5b
7
- data.tar.gz: 484bdd95c5fc999503a9641589bf1f583fb6b2a22b00a4c06fe483f05cda344d5b68e143b367cf5caaf138f79cf05e41fea84c721b4dc4882ea74c604f59f833
6
+ metadata.gz: c131bee117f67f0ad2735d6b5ef82ccd68265db53564fc98f1cbb6f090c954983c7de7470628992757be9ab50b76fa6549d511157441e689322477d7d2d4dbd2
7
+ data.tar.gz: b31abce91b7e2a2773f162143aabf96dd71563c24f5e4350e40750e95089491ca4f496c7d44e2a0bea85d4fd0ec51b1088a38ce472864e5d6beaec226cb63b4a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- youtube_parser (0.1.0)
4
+ youtube_parser (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,9 +1,4 @@
1
1
  # YoutubeParser
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/youtube_parser`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
2
  ## Installation
8
3
 
9
4
  Add this line to your application's Gemfile:
@@ -26,7 +21,12 @@ To fetch youtube channel info:
26
21
  ```ruby
27
22
  require 'youtube_parser'
28
23
 
29
- YoutubeParser::Channel.new('https://www.youtube.com/channel/channel_id').info
24
+ user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 '\
25
+ '(KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
26
+ options = { channel_url: 'https://www.youtube.com/channel/channel_id',
27
+ user_agent: user_agent }
28
+
29
+ YoutubeParser::Channel.new(options).info
30
30
  ```
31
31
 
32
32
  ## Development
@@ -24,6 +24,11 @@ module YoutubeParser
24
24
  section.dig(*keys.title)
25
25
  end
26
26
 
27
+ def email
28
+ regex = /#{URI::MailTo::EMAIL_REGEXP.source.gsub(/\\A|\\z/, '')}/
29
+ description[regex]
30
+ end
31
+
27
32
  def description
28
33
  descriptions = [section.dig(*keys.description_first),
29
34
  section.dig(*keys.description_second)]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YoutubeParser
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youtube_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - o.vykhor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-31 00:00:00.000000000 Z
11
+ date: 2020-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler