binged 0.2.0 → 0.3.0
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.
- data/HISTORY +5 -0
- data/VERSION +1 -1
- data/binged.gemspec +6 -2
- data/lib/binged/client.rb +7 -0
- data/lib/binged/search/image.rb +25 -0
- data/lib/binged/search/video.rb +97 -0
- data/lib/binged/search.rb +1 -0
- data/spec/binged/search/video_spec.rb +119 -0
- data/spec/binged_spec.rb +18 -3
- data/spec/fixtures/videos.json +9 -0
- metadata +7 -3
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/binged.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{binged}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kevin Faustino"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-15}
|
13
13
|
s.description = %q{A wrapper for the bing api}
|
14
14
|
s.email = %q{kevin.faustino@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,11 +31,14 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/binged/search.rb",
|
32
32
|
"lib/binged/search/base.rb",
|
33
33
|
"lib/binged/search/image.rb",
|
34
|
+
"lib/binged/search/video.rb",
|
34
35
|
"lib/binged/search/web.rb",
|
35
36
|
"spec/binged/search/image_spec.rb",
|
37
|
+
"spec/binged/search/video_spec.rb",
|
36
38
|
"spec/binged/search/web_spec.rb",
|
37
39
|
"spec/binged_spec.rb",
|
38
40
|
"spec/fixtures/images.json",
|
41
|
+
"spec/fixtures/videos.json",
|
39
42
|
"spec/fixtures/web.json",
|
40
43
|
"spec/spec.opts",
|
41
44
|
"spec/spec_helper.rb",
|
@@ -49,6 +52,7 @@ Gem::Specification.new do |s|
|
|
49
52
|
s.summary = %q{A wrapper for the bing api}
|
50
53
|
s.test_files = [
|
51
54
|
"spec/binged/search/image_spec.rb",
|
55
|
+
"spec/binged/search/video_spec.rb",
|
52
56
|
"spec/binged/search/web_spec.rb",
|
53
57
|
"spec/binged_spec.rb",
|
54
58
|
"spec/spec_helper.rb",
|
data/lib/binged/client.rb
CHANGED
@@ -24,6 +24,13 @@ module Binged
|
|
24
24
|
def image(query='')
|
25
25
|
Search::Image.new(self,query)
|
26
26
|
end
|
27
|
+
|
28
|
+
# Create a video search through Bing
|
29
|
+
#
|
30
|
+
# @param [String] query The search term to be sent to Bing
|
31
|
+
def video(query='')
|
32
|
+
Search::Video.new(self,query)
|
33
|
+
end
|
27
34
|
|
28
35
|
end
|
29
36
|
|
data/lib/binged/search/image.rb
CHANGED
@@ -17,18 +17,23 @@ module Binged
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# Restrict images to those small in size
|
20
|
+
#
|
21
|
+
# @return [self]
|
20
22
|
def small
|
21
23
|
filter << 'Size:Small'
|
22
24
|
self
|
23
25
|
end
|
24
26
|
|
25
27
|
# Restrict images to those medium in size
|
28
|
+
#
|
29
|
+
# @return [self]
|
26
30
|
def medium
|
27
31
|
filter << 'Size:Medium'
|
28
32
|
self
|
29
33
|
end
|
30
34
|
|
31
35
|
# Restrict images to those large in size
|
36
|
+
# @return [self]
|
32
37
|
def large
|
33
38
|
filter << 'Size:Large'
|
34
39
|
self
|
@@ -37,6 +42,7 @@ module Binged
|
|
37
42
|
# Restrict images to the specified height in pixels
|
38
43
|
#
|
39
44
|
# @param [Fixnum] pixels height in pixels
|
45
|
+
# @return [self]
|
40
46
|
def height(pixels)
|
41
47
|
filter << "Size:Height:#{pixels}"
|
42
48
|
self
|
@@ -45,60 +51,79 @@ module Binged
|
|
45
51
|
# Restrict images to the specified width in pixels
|
46
52
|
#
|
47
53
|
# @param [Fixnum] pixels width in pixels
|
54
|
+
# @return [self]
|
48
55
|
def width(pixels)
|
49
56
|
filter << "Size:Width:#{pixels}"
|
50
57
|
self
|
51
58
|
end
|
52
59
|
|
53
60
|
# Restrict images to those that have a square aspect ratio
|
61
|
+
#
|
62
|
+
# @return [self]
|
54
63
|
def square
|
55
64
|
filter << 'Aspect:Square'
|
56
65
|
self
|
57
66
|
end
|
58
67
|
|
59
68
|
# Restrict images to those that have a wide aspect ratio
|
69
|
+
#
|
70
|
+
# @return [self]
|
60
71
|
def wide
|
61
72
|
filter << 'Aspect:Wide'
|
62
73
|
self
|
63
74
|
end
|
64
75
|
|
65
76
|
# Restrict images to those that have a tall aspect ratio
|
77
|
+
#
|
78
|
+
# @return [self]
|
66
79
|
def tall
|
67
80
|
filter << 'Aspect:Tall'
|
68
81
|
self
|
69
82
|
end
|
70
83
|
|
71
84
|
# Restrict images to those that are in color
|
85
|
+
#
|
86
|
+
# @return [self]
|
72
87
|
def color
|
73
88
|
filter << 'Color:Color'
|
74
89
|
self
|
75
90
|
end
|
76
91
|
|
77
92
|
# Restrict images to those which contain photos
|
93
|
+
#
|
94
|
+
# @return [self]
|
78
95
|
def photo
|
79
96
|
filter << 'Style:Photo'
|
80
97
|
self
|
81
98
|
end
|
82
99
|
|
83
100
|
# Restrict images to those which contain graphics or illustrations
|
101
|
+
#
|
102
|
+
# @return [self]
|
84
103
|
def graphics
|
85
104
|
filter << 'Style:Graphics'
|
86
105
|
self
|
87
106
|
end
|
88
107
|
|
89
108
|
# Restrict images to those that are in black and white
|
109
|
+
#
|
110
|
+
# @return [self]
|
90
111
|
def monochrome
|
91
112
|
filter << 'Color:Monochrome'
|
92
113
|
self
|
93
114
|
end
|
94
115
|
|
95
116
|
# Restrict images to those which contain faces
|
117
|
+
#
|
118
|
+
# @return [self]
|
96
119
|
def face
|
97
120
|
filter << 'Face:Face'
|
98
121
|
self
|
99
122
|
end
|
100
123
|
|
101
124
|
# Restrict images to those which contain portraits(head and shoulders)
|
125
|
+
#
|
126
|
+
# @return [self]
|
102
127
|
def portrait
|
103
128
|
filter << 'Face:Portrait'
|
104
129
|
self
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Binged
|
2
|
+
module Search
|
3
|
+
|
4
|
+
class Video < Base
|
5
|
+
include Filter
|
6
|
+
include Pageable
|
7
|
+
|
8
|
+
SUPPORTED_RESOLUTIONS = [:low, :medium, :high]
|
9
|
+
SUPPORTED_SORT_OPTIONS = [:date, :relevance]
|
10
|
+
|
11
|
+
# @param [Binged::Client] client
|
12
|
+
# @param [String] query The search term to be sent to Bing
|
13
|
+
# @param [Hash] options
|
14
|
+
def initialize(client, query=nil, options={})
|
15
|
+
super(client, query)
|
16
|
+
@source = :video
|
17
|
+
set_paging_defaults
|
18
|
+
create_filter_callback
|
19
|
+
end
|
20
|
+
|
21
|
+
# Change the sorting of the video search
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# search.sort_by(:date) # Return videos in chronological order
|
25
|
+
#
|
26
|
+
# @param [Symbol] type A symbol of a {SUPPORTED_SORT_OPTIONS}
|
27
|
+
# @return [self]
|
28
|
+
# @see http://msdn.microsoft.com/en-us/library/dd560945.aspx Description of all sort options
|
29
|
+
def sort_by(type)
|
30
|
+
@query['Video.SortBy'] = type if SUPPORTED_SORT_OPTIONS.include?(type)
|
31
|
+
self
|
32
|
+
end
|
33
|
+
|
34
|
+
# Video duration is less than 300 seconds
|
35
|
+
#
|
36
|
+
# @return [self]
|
37
|
+
def short
|
38
|
+
filter << 'Duration:Short'
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
42
|
+
# Video duration is between 300 seconds and 12000 seconds
|
43
|
+
#
|
44
|
+
# @return [self]
|
45
|
+
def medium
|
46
|
+
filter << 'Duration:Medium'
|
47
|
+
self
|
48
|
+
end
|
49
|
+
|
50
|
+
# Video duration is larger than 12000 seconds
|
51
|
+
#
|
52
|
+
# @return [self]
|
53
|
+
def long
|
54
|
+
filter << 'Duration:Long'
|
55
|
+
self
|
56
|
+
end
|
57
|
+
|
58
|
+
# Restrict videos to those which have a standard aspect ratio
|
59
|
+
#
|
60
|
+
# @return [self]
|
61
|
+
def standard
|
62
|
+
filter << 'Aspect:Standard'
|
63
|
+
self
|
64
|
+
end
|
65
|
+
|
66
|
+
# Restrict videos to those which have a widescreen aspect ratio
|
67
|
+
#
|
68
|
+
# @return [self]
|
69
|
+
def widescreen
|
70
|
+
filter << 'Aspect:Widescreen'
|
71
|
+
self
|
72
|
+
end
|
73
|
+
|
74
|
+
# Restrict videos to those which have a certain resolution
|
75
|
+
#
|
76
|
+
# @param [Symbol] type A symbol of a {SUPPORTED_RESOLUTIONS}
|
77
|
+
# @return [self]
|
78
|
+
def resolution(type)
|
79
|
+
filter << "Resolution:#{type.to_s.capitalize}" if SUPPORTED_RESOLUTIONS.include?(type)
|
80
|
+
self
|
81
|
+
end
|
82
|
+
|
83
|
+
private
|
84
|
+
|
85
|
+
def create_filter_callback
|
86
|
+
key = 'Video.Filters'
|
87
|
+
@callbacks << Proc.new { |query| query[key] = query[key].join('+') if query[key] }
|
88
|
+
end
|
89
|
+
|
90
|
+
def filter
|
91
|
+
@query['Video.Filters'] ||= []
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
end
|
data/lib/binged/search.rb
CHANGED
@@ -0,0 +1,119 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Binged
|
4
|
+
module Search
|
5
|
+
|
6
|
+
describe "Video" do
|
7
|
+
include AnyFilter
|
8
|
+
include AnyPageable
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@client = Binged::Client.new(:api_key => 'binged')
|
12
|
+
@search = Video.new(@client)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should initialize with a search term" do
|
16
|
+
Video.new(@client, 'ruby').query[:Query].should include('ruby')
|
17
|
+
end
|
18
|
+
|
19
|
+
context "sorting" do
|
20
|
+
|
21
|
+
it "should be able to sort by date" do
|
22
|
+
@search.sort_by(:date)
|
23
|
+
@search.query['Video.SortBy'].should == :date
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should be able to sort by relevance" do
|
27
|
+
@search.sort_by(:relevance)
|
28
|
+
@search.query['Video.SortBy'].should == :relevance
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should ignore unsupported sort options" do
|
32
|
+
@search.sort_by(:boring)
|
33
|
+
@search.query['Video.SortBy'].should be_nil
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
context "filtering" do
|
39
|
+
|
40
|
+
describe "duration" do
|
41
|
+
|
42
|
+
%w(Short Medium Long).each do |duration|
|
43
|
+
it "should filter by a #{duration} duration" do
|
44
|
+
@search.send duration.downcase.to_sym
|
45
|
+
@search.query['Video.Filters'].should include("Duration:#{duration}")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "aspect" do
|
52
|
+
|
53
|
+
%w(Standard Widescreen).each do |aspect|
|
54
|
+
it "should filter by a #{aspect} aspect ratio" do
|
55
|
+
@search.send aspect.downcase.to_sym
|
56
|
+
@search.query['Video.Filters'].should include("Aspect:#{aspect}")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "resolution" do
|
63
|
+
%w(Low Medium High).each do |resolution|
|
64
|
+
it "should filter by a #{resolution} resolution" do
|
65
|
+
@search.resolution resolution.downcase.to_sym
|
66
|
+
@search.query['Video.Filters'].should include("Resolution:#{resolution}")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
context "fetching" do
|
74
|
+
before(:each) do
|
75
|
+
stub_get "http://api.bing.net/json.aspx?AppId=binged&Sources=video&JsonType=raw&Video.Count=20&Version=2.2&Query=RailsConf&Video.Offset=0", "videos.json"
|
76
|
+
@search.containing('RailsConf')
|
77
|
+
@response = @search.fetch
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should cache fetch to eliminate multiple calls to the api" do
|
81
|
+
Video.should_not_receive(:perform)
|
82
|
+
@search.fetch
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should return the results of the search" do
|
86
|
+
@response.results.size.should == 20
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should support dot notation" do
|
90
|
+
video = @response.results.first
|
91
|
+
video.title.should == 'RailsConf Europe 08: Jeremy Kemper (37signals), Performance on Rails'
|
92
|
+
video.play_url.should == 'http://railsconfeurope.blip.tv/file/1555719/'
|
93
|
+
video.source_title.should == 'blip.tv'
|
94
|
+
video.static_thumbnail.should_not be_nil
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
context "iterating over results" do
|
100
|
+
|
101
|
+
before(:each) do
|
102
|
+
stub_get "http://api.bing.net/json.aspx?AppId=binged&Sources=video&JsonType=raw&Video.Count=20&Version=2.2&Query=RailsConf&Video.Offset=0", "videos.json"
|
103
|
+
@search.containing('RailsConf')
|
104
|
+
end
|
105
|
+
|
106
|
+
it "should be able to iterate through results" do
|
107
|
+
@search.should respond_to(:each)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "should have items" do
|
111
|
+
@search.each {|result| result.should_not be_nil }
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
end
|
data/spec/binged_spec.rb
CHANGED
@@ -11,9 +11,24 @@ describe "Binged" do
|
|
11
11
|
client.api_key.should == 'api_key'
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
describe "Flexible interface" do
|
15
|
+
|
16
|
+
before(:each) do
|
17
|
+
@client = Binged::Client.new
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should provide an interface to web search" do
|
21
|
+
@client.web.should be_instance_of(Binged::Search::Web)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should provide an interface to image search" do
|
25
|
+
@client.image.should be_instance_of(Binged::Search::Image)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should provide an interface to video search" do
|
29
|
+
@client.video.should be_instance_of(Binged::Search::Video)
|
30
|
+
end
|
31
|
+
|
17
32
|
end
|
18
33
|
|
19
34
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Cache-Control: private
|
3
|
+
Content-Length: 11348
|
4
|
+
Content-Type: application/json; charset=utf-8
|
5
|
+
P3P: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND", policyref="http://privacy.msn.com/w3c/p3p.xml"
|
6
|
+
Date: Mon, 15 Mar 2010 14:12:07 GMT
|
7
|
+
Connection: keep-alive
|
8
|
+
|
9
|
+
{"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"RailsConf"},"Video":{"Total":590,"Offset":0,"Results":[{"Title":"RailsConf Europe 08: Jeremy Kemper (37signals), Performance on Rails","PlayUrl":"http:\/\/railsconfeurope.blip.tv\/file\/1555719\/","SourceTitle":"blip.tv","RunTime":597535,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1666215903653&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1666215903653&id=38ccf20d92796c3f9efb97a803c49e2e&bid=38MngnWoXhyVjw&bn=Thumb&url=http%3a%2f%2fblip.tv%2ffile%2fget%2fRailsConfEurope-RailsConfEurope08JeremyKemper37signalsPerformanceOnTheR446.f","ContentType":"image\/jpeg","Width":160,"Height":122,"FileSize":4270}},{"Title":"RailsConf 09: Robert Martin, \"What Killed Smalltalk Could K","PlayUrl":"http:\/\/www.youtube.com\/watch?v=YX3iRjKj7C0","SourceTitle":"YouTube","RunTime":3656000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1583759229951&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1583759229951&id=1174b76373c28b5411fe678bcd72ee29&bid=ywEsiTZzucpRgg&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dYX3iRjKj7C0","ContentType":"image\/jpeg","Width":160,"Height":90,"FileSize":2448}},{"Title":"RailsConf 2007 Portland","PlayUrl":"http:\/\/www.youtube.com\/watch?v=9rhX0CY_218","SourceTitle":"YouTube","RunTime":479000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1592793169998&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1592793169998&id=4b3401fa9ca7cf8f41ee8eb58b7b3df6&bid=wciCsZA%2bm5HWUA&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3d9rhX0CY_218","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3747}},{"Title":"RailsConf 2007 - Avi Bryant","PlayUrl":"http:\/\/blip.tv\/file\/568689","SourceTitle":"blip.tv","RunTime":2281151,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1582129348662&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1582129348662&id=b151f3f8e70c7eed193b8945e782d2b6&bid=8cCSITwihkfbhw&bn=Thumb&url=http%3a%2f%2fblip.tv%2ffile%2fget%2fRailsConf-RailsConf2007AviBryant469.flv","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":2901}},{"Title":"RailsConf Europe 08: David Heinemeier Hansson (37signals)","PlayUrl":"http:\/\/www.youtube.com\/watch?v=CJkiCpPeYuI","SourceTitle":"YouTube","RunTime":3933000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1502020436404&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1502020436404&id=46599dcc63d3b52da833228b0702c52e&bid=wzySpI1mafUq8A&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dCJkiCpPeYuI","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3229}},{"Title":"RailsConf Europe 08: Jeremy Kemper (37signals), Performance","PlayUrl":"http:\/\/www.youtube.com\/watch?v=ylI3M60BIOg","SourceTitle":"YouTube","RunTime":3719000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1501356163209&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1501356163209&id=e8f24b43ce061804f8bb446f96bceed8&bid=x2TEi554VaYq9w&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dylI3M60BIOg","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":2746}},{"Title":"RailsConf 09: \"Ruby Heroes Award Ceremony\"","PlayUrl":"http:\/\/www.youtube.com\/watch?v=xk1iUPyKBog","SourceTitle":"YouTube","RunTime":834000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1624751408520&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1624751408520&id=326bd716e7d0994951556bcf7244027a&bid=p%2bGUJmnPUjS2iw&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dxk1iUPyKBog","ContentType":"image\/jpeg","Width":160,"Height":90,"FileSize":2280}},{"Title":"Joel Spolsky Interview at RailsConf 2008","PlayUrl":"http:\/\/www.youtube.com\/watch?v=q1jAKk5Yax0","SourceTitle":"YouTube","RunTime":325000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1592903532589&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1592903532589&id=cda6600106cf89e0dc6d7d9eb299f42e&bid=dofJVe75NQwxZQ&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dq1jAKk5Yax0","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3264}},{"Title":"RailsConf Europe 2007","PlayUrl":"http:\/\/www.youtube.com\/watch?v=vA8w2J_1Djw","SourceTitle":"YouTube","RunTime":198000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1524716404858&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1524716404858&id=b9062e335afdcfcb5db8f215608d6d23&bid=51fabomcjCF8ag&bn=Thumb&url=http%3a%2f%2fyoutube.com%2fwatch%3fv%3dvA8w2J_1Djw","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":4311}},{"Title":"RailsConf 09: Tim Ferriss, \"A Conversation with Tim Ferriss\"","PlayUrl":"http:\/\/www.youtube.com\/watch?v=CUJGOq46jC8","SourceTitle":"YouTube","RunTime":4012000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1596112700138&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1596112700138&id=572ef89d6f881291a024621794af147c&bid=GlFxgApjVSlO3A&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dCUJGOq46jC8","ContentType":"image\/jpeg","Width":160,"Height":90,"FileSize":2593}},{"Title":"RailsConf Europe 08: David Heinemeier Hansson and Rails Core Members ... ","PlayUrl":"http:\/\/www.blip.tv\/file\/1552398","SourceTitle":"blip.tv","RunTime":3504638,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1688270603176&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1688270603176&id=1110b7a889ebbc765f03f67c02e0ab7b&bid=S%2brvBYHWaoz%2bLg&bn=Thumb&url=http%3a%2f%2fwww.blip.tv%2ffile%2f1552398","ContentType":"image\/jpeg","Width":160,"Height":122,"FileSize":4335}},{"Title":"RailsConf 2007 - Jamis Buck & Michael Koziarski","PlayUrl":"http:\/\/blip.tv\/file\/568496","SourceTitle":"blip.tv","RunTime":3832169,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1509492916461&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1509492916461&id=2c03521174b514bc383ac8c3bfa5a0d4&bid=yoeHiQMzVsQQhg&bn=Thumb&url=http%3a%2f%2fwww.blip.tv%2ffile%2f568496","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":2940}},{"Title":"RailsConf Europe 08: David A. Black (Ruby Central, Inc.), Ruby and ... ","PlayUrl":"http:\/\/www.blip.tv\/file\/1555640","SourceTitle":"blip.tv","RunTime":3781824,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1688238228739&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1688238228739&id=3ac4668161fcee0ec7c82f37616a1364&bid=vy%2fdlcTpdlHmrw&bn=Thumb&url=http%3a%2f%2fwww.blip.tv%2ffile%2f1555640","ContentType":"image\/jpeg","Width":160,"Height":122,"FileSize":3187}},{"Title":"RailsConf 09: Rails Core Panel","PlayUrl":"http:\/\/www.youtube.com\/watch?v=_jvHRPPCjgs","SourceTitle":"YouTube","RunTime":2534000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1596173582578&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1596173582578&id=572ef89d6f881291a024621794af147c&bid=dumwNo2ugJrUYw&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3d_jvHRPPCjgs","ContentType":"image\/jpeg","Width":160,"Height":90,"FileSize":2593}},{"Title":"Ryan Singer Interview at RailsConf 2008","PlayUrl":"http:\/\/www.youtube.com\/watch?v=OR0prVLD3rk","SourceTitle":"YouTube","RunTime":236000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1611416797195&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1611416797195&id=a286cc0e2ee37e9bbe860401071c946e&bid=jBOOJ6o8XoGdWQ&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dOR0prVLD3rk","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3519}},{"Title":"RailsConf - Rails Entrepreneurs Panel - Audience Question 1","PlayUrl":"http:\/\/blip.tv\/file\/2090552","SourceTitle":"blip.tv","RunTime":287633,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1418070065913&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1418070065913&id=e2123201808cbc3a21b8d5683aac5bd3&bid=3E53OE8hXFKbPg&bn=Thumb&url=http%3a%2f%2fblip.tv%2ffile%2f2090552","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3466}},{"Title":"RailsConf Keynote: David Heinemeier Hansson","PlayUrl":"http:\/\/www.youtube.com\/watch?v=mp4z2eK1Avw","SourceTitle":"YouTube","RunTime":600000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1728022709292&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1728022709292&id=faf1d4ff775253fc2bb1c698da9a3b0c&bid=9sG2Kd1TvKsing&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dmp4z2eK1Avw","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3884}},{"Title":"RailsConf 09: Chris Wanstrath, \"How to become a famous Rails Developer ... ","PlayUrl":"http:\/\/www.youtube.com\/watch?v=JUUvq48Gb3w","SourceTitle":"YouTube","RunTime":2085000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1693505815643&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts2.mm.bing.net\/videos\/thumbnail.aspx?q=1693505815643&id=d4567b654e65c113db2eae8d18fc9a6c&bid=KLhv5%2bJAZ1Zu7Q&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dJUUvq48Gb3w","ContentType":"image\/jpeg","Width":160,"Height":90,"FileSize":2107}},{"Title":"RailsConf - Rails Entrepreneurs Panel - Question 1","PlayUrl":"http:\/\/blip.tv\/file\/2084327\/","SourceTitle":"blip.tv","RunTime":366313,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1625994757306&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1625994757306&id=54a5e05add041a95f2dccdba0086709b&bid=%2bPO2UJjNm3%2bzRQ&bn=Thumb&url=http%3a%2f%2fblip.tv%2ffile%2f2084327%2f","ContentType":"image\/jpeg","Width":160,"Height":90,"FileSize":2786}},{"Title":"RailsConf 2008 Welcome Keynote","PlayUrl":"http:\/\/www.youtube.com\/watch?v=ZrOOuWjhOFQ","SourceTitle":"YouTube","RunTime":183000,"ClickThroughPageUrl":"http:\/\/www.bing.com\/videos\/search?q=RailsConf&scope=video&docid=1464792973964&FORM=SOAPGN","StaticThumbnail":{"Url":"http:\/\/ts1.mm.bing.net\/videos\/thumbnail.aspx?q=1464792973964&id=aa9861d8626ad43db820dd73f4bbe376&bid=gUyenvSOSOj73A&bn=Thumb&url=http%3a%2f%2fwww.youtube.com%2fwatch%3fv%3dZrOOuWjhOFQ","ContentType":"image\/jpeg","Width":160,"Height":120,"FileSize":3740}}]}}}
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kevin Faustino
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-15 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -109,11 +109,14 @@ files:
|
|
109
109
|
- lib/binged/search.rb
|
110
110
|
- lib/binged/search/base.rb
|
111
111
|
- lib/binged/search/image.rb
|
112
|
+
- lib/binged/search/video.rb
|
112
113
|
- lib/binged/search/web.rb
|
113
114
|
- spec/binged/search/image_spec.rb
|
115
|
+
- spec/binged/search/video_spec.rb
|
114
116
|
- spec/binged/search/web_spec.rb
|
115
117
|
- spec/binged_spec.rb
|
116
118
|
- spec/fixtures/images.json
|
119
|
+
- spec/fixtures/videos.json
|
117
120
|
- spec/fixtures/web.json
|
118
121
|
- spec/spec.opts
|
119
122
|
- spec/spec_helper.rb
|
@@ -151,6 +154,7 @@ specification_version: 3
|
|
151
154
|
summary: A wrapper for the bing api
|
152
155
|
test_files:
|
153
156
|
- spec/binged/search/image_spec.rb
|
157
|
+
- spec/binged/search/video_spec.rb
|
154
158
|
- spec/binged/search/web_spec.rb
|
155
159
|
- spec/binged_spec.rb
|
156
160
|
- spec/spec_helper.rb
|