youtube_parser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -6
- data/lib/youtube_parser/channels/about_section.rb +5 -0
- data/lib/youtube_parser/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: 2787d7682c42086c3586dd86a774760b0ee78f314ab297cc06e669cd1c5b8167
|
4
|
+
data.tar.gz: 537a9cdf529e9b5760661aa75188bfc0990d82402de42776f9ebd6786394bc8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c131bee117f67f0ad2735d6b5ef82ccd68265db53564fc98f1cbb6f090c954983c7de7470628992757be9ab50b76fa6549d511157441e689322477d7d2d4dbd2
|
7
|
+
data.tar.gz: b31abce91b7e2a2773f162143aabf96dd71563c24f5e4350e40750e95089491ca4f496c7d44e2a0bea85d4fd0ec51b1088a38ce472864e5d6beaec226cb63b4a
|
data/Gemfile.lock
CHANGED
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
|
-
|
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)]
|
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.
|
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:
|
11
|
+
date: 2020-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|