youtube_video_search_at_web_page 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: da4d959b364c1187f59209efb51d893c0d880097
4
+ data.tar.gz: 7281940c14bc1ea3ada3796f00e85cbc2db278c8
5
+ SHA512:
6
+ metadata.gz: 84986541f2d6d9e423b2fbce7ddbc0cfa67221d405d65bb03304f86152152d3f2ce71352575661c74056129acaa04eb305b88130e35a1e12c4f95c24e7fcd90a
7
+ data.tar.gz: 6554afa880225e436a545c55828a401c9f4ae1f05fb3734c811a48266bea224170ff169b89a630a8eb7ed9824404e60ee3553465616b5ef06d256339be3fb41f
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+
4
+ gem 'nokogiri'
5
+ gem 'rspec'
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 ie4
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,6 @@
1
+ # Youtube Video Search at Web Page
2
+
3
+ by ie4 ( http://ie4.me/ )
4
+
5
+ https://github.com/ie4/youtube_video_search_at_web_page
6
+
@@ -0,0 +1,7 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
@@ -0,0 +1,18 @@
1
+ #encoding: utf-8
2
+ require "open-uri"
3
+ require "nokogiri"
4
+
5
+ class YoutubeVideoSearchAtWebPage
6
+
7
+ def get_list(query)
8
+ url = 'https://www.youtube.com/results?search_query='+query
9
+ @scraped_data = Nokogiri::HTML(open(url))
10
+ @scraped_data.css(".yt-lockup-video").collect do |elm|
11
+ [
12
+ elm.css("h3 a").attribute("title").value,
13
+ elm.attribute("data-context-item-id").value
14
+ ]
15
+ end
16
+ end
17
+
18
+ end
@@ -0,0 +1,3 @@
1
+ module YoutubeVideoSearchAtWebPage
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'youtube_video_search_at_web_page'
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe YoutubeVideoSearchAtWebPage do
4
+ it 'item count is expected 17 (at first page)' do
5
+ list = YoutubeVideoSearchAtWebPage.new.get_list("ne-yo")
6
+ expect(list.length).to be == 17
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'youtube_video_search_at_web_page/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "youtube_video_search_at_web_page"
8
+ spec.version = YoutubeVideoSearchAtWebPage::VERSION
9
+ spec.authors = ["ie4"]
10
+ spec.email = ["kei@ie4.me"]
11
+ spec.summary = %q{video search at youtube web page}
12
+ spec.description = %q{}
13
+ spec.homepage = "https://github.com/ie4/youtube_video_search_at_web_page"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec"
24
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: youtube_video_search_at_web_page
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - ie4
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: ''
56
+ email:
57
+ - kei@ie4.me
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - lib/youtube_video_search_at_web_page.rb
69
+ - lib/youtube_video_search_at_web_page/version.rb
70
+ - spec/spec_helper.rb
71
+ - spec/youtube_video_search_at_web_page_spec.rb
72
+ - youtube_video_search_at_web_page.gemspec
73
+ homepage: https://github.com/ie4/youtube_video_search_at_web_page
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.2.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: video search at youtube web page
97
+ test_files:
98
+ - spec/spec_helper.rb
99
+ - spec/youtube_video_search_at_web_page_spec.rb