social_parser 1.0.1 → 1.0.2
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/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/lib/social_parser/provider/youtube.rb +2 -1
- data/lib/social_parser/version.rb +1 -1
- data/logo.png +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98620fd027c087359bca02d4ad8d69166faed0ab
|
4
|
+
data.tar.gz: 5043037f672694a5bb9a26b2929b112ab092d2a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0213be44eea4ec750fb24b122d3c6a5df6319659413b71c462b8f20a36341b3b51b137e8a6f0ac4b2428afd5912b7348f5dc4c14863c07e11ae6383d261874a7
|
7
|
+
data.tar.gz: 219541d772dd9d6b55433a8cc41bbb31b8f156d041f1b0cf441614120f5678d677ec38e284c36974e00677230983be1640b105d266c778edd6491342e524a1e3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
# SocialParser
|
2
2
|
|
3
|
+

|
4
|
+
|
3
5
|
Parse social media attributes from url or construct url from attributes.
|
4
6
|
|
7
|
+
### Supported provider
|
8
|
+
|
9
|
+
`[:facebook, :github, :instagram, :github, :google, :linkedin, :medium, :pinterest, :qiita, :twitter, :vimeo, :youtube]`
|
5
10
|
|
6
11
|
## Installation
|
7
12
|
|
@@ -4,6 +4,7 @@ module SocialParser
|
|
4
4
|
module Provider
|
5
5
|
class Youtube < Base
|
6
6
|
URL_FORMATS = {
|
7
|
+
embed: /\A((https?)?:\/\/)?(www\.)?youtube\.com\/embed\/(?<id>[\w\-\.]+)\/?/i,
|
7
8
|
video: /\A((https?)?:\/\/)?(www\.)?youtube\.com\/watch\?v=(?<id>[\w\-\.]+)\/?/i,
|
8
9
|
full: /\A((https?)?:\/\/)?(www\.)?youtube\.com\/(?<type>(user|channel|playlist))\/(?<id>[\w\-\.]+)\/?/i,
|
9
10
|
shortend: /\A((https?)?:\/\/)?(www\.)?youtube\.com\/(?<id>[\w\-\.]+)\/?/i,
|
@@ -44,7 +45,7 @@ module SocialParser
|
|
44
45
|
if key == :full
|
45
46
|
@type = m[:type]
|
46
47
|
return nil if @type != 'user'
|
47
|
-
elsif key == :video
|
48
|
+
elsif key == :video || key == :embed
|
48
49
|
@type = 'video'
|
49
50
|
end
|
50
51
|
return m[:id]
|
data/logo.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pokohide
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- lib/social_parser/provider/vimeo.rb
|
100
100
|
- lib/social_parser/provider/youtube.rb
|
101
101
|
- lib/social_parser/version.rb
|
102
|
+
- logo.png
|
102
103
|
- social_parser.gemspec
|
103
104
|
homepage: https://github.com/hyde2able/SocialParser
|
104
105
|
licenses:
|