ytsearch 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/ytsearch.rb +16 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4e1454f07ab5ad94463ca1da907b85b62d30997d189d3ad6384a72b9f5050845
|
4
|
+
data.tar.gz: 6923a57d75643ac5869ce49762a9a45576ee0fbfdd6b02e74ec07cbbd8318ce7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ab79945c98baa099e72b50f19e98385916afbd389d06118875dda95f4ece317d2e3c89e5796d041acc965ec31d522b13c700935802cb948fe91f2ac664b71d0e
|
7
|
+
data.tar.gz: a28588c9def9a6c162627857bb5819eb49687654e6f56616bb740dd6e253c42e7ae1c48a2045f782cdf505c288084a6a71fe4c98f25cbf32d63daf213bdae648
|
data/lib/ytsearch.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'json'
|
3
|
+
require 'dotenv'
|
4
|
+
|
5
|
+
Dotenv.load
|
6
|
+
|
7
|
+
class YoutubeSearch
|
8
|
+
API_URL = 'https://www.googleapis.com/youtube/v3/search'
|
9
|
+
API_KEY = ENV['API_KEY']
|
10
|
+
|
11
|
+
def self.search(options={})
|
12
|
+
query = options.map{|k,v| "#{k}=#{v}"}.join('&')
|
13
|
+
response = open("#{API_URL}?key=#{API_KEY}&#{query}").read
|
14
|
+
response = JSON.parse(response)
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ytsearch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Timothy de Jongh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Search YouTube videos using v3 API
|
14
|
+
email: icetimux@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/ytsearch.rb
|
20
|
+
homepage: http://icetimux.net
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubygems_version: 3.1.4
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: YouTube Search
|
43
|
+
test_files: []
|