kylejginavan / youtube_it

An object-oriented Ruby wrapper for the YouTube GData API
http://groups.google.com/group/ruby-youtube-library
595 stars 223 forks source link

Query plus filter by published date #136

Closed owenconnor closed 11 years ago

owenconnor commented 11 years ago

I am trying to make a call which returns videos form either to day or a date range which match a query also. For example a query for videos about cats which were published today should look something like client.videos_by(:fields => {:published => (Date.today), :query => "cat"}) Shouldn't it?

I've tried a few different alternatives with no success thus far. Videos from today will be returned but the query param is ineffectual. Is this type of date filtered query possible via the gem. If so what format should it take?

chebyte commented 11 years ago

can you pastie the sintaxis that you use and the result?

chebyte commented 11 years ago

it works perfect for me

starts_at = Date.today - 10000
ends_at = Date.today

puts client.videos_by(:query => "tuquito", :fields => {:published => (starts_at..ends_at)}).videos.map(&:title)

and returns

Tuquito 2.0 Linux Argentino
Tuquito 4.1 WIchi LXDE
Tuquito 3.1 más rápido que Ubuntu 9.10
Tuquito Control Center 0.3
......