Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grosser/youtube_search
Search youtube via this simple ruby api
https://github.com/grosser/youtube_search
Last synced: 11 days ago
JSON representation
Search youtube via this simple ruby api
- Host: GitHub
- URL: https://github.com/grosser/youtube_search
- Owner: grosser
- Created: 2011-10-14T09:45:38.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2015-01-12T00:39:08.000Z (almost 10 years ago)
- Last Synced: 2024-10-23T14:05:11.738Z (19 days ago)
- Language: Ruby
- Homepage:
- Size: 302 KB
- Stars: 67
- Watchers: 8
- Forks: 23
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
Search youtube via this simple ruby api
- simple
- no dependenciesInstall
=======```Bash
gem install youtube_search
```Usage
=====```Ruby
YoutubeSearch.search('boat').first
{
"title"=>"Killer Whale Imitates Boat Motor",
"published"=>"2011-09-29T15:30:43.000Z",
"id"=>"http://gdata.youtube.com/feeds/api/videos/0b2U5r7Jwkc",
"video_id"=>"0b2U5r7Jwkc",
"content"=>"Top YouTube Videos on ...",
"updated"=>"2011-10-13T20:20:54.000Z",
"raw" => ,
"embeddable" => true,
...
}
```or raw json with `format: 'json'`
page / per_page are supported
```Ruby
YoutubeSearch.search('cats', :page => 10, :per_page => 4).first
```and [standard youtube options](http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Standard_parameters)
```Ruby
YoutubeSearch.search('cats', 'time' => 'this_week', 'orderby' => 'viewCount').first
```### I can haz iframe:
```Ruby
# DISCLAIMER this iframe may steal 4 minutes of your life ;)
id = YoutubeSearch.search('lolcats').first['video_id']
%{}
```### Searching playlists
```Ruby
YoutubeSearch.search_playlists('cats').first
```### Retrieve videos by playlist ID
```Ruby
videos = YoutubeSearch.playlist_videos('5F23DAF4BFE3D14C')
```TODO
====
- more detailed xml parsing (you can fetch everything via 'raw', but more defaults would be nice)
- parse dates into ruby objectsAuthor
======### [Contributors](https://github.com/grosser/youtube_search/contributors)
- [David Gil](https://qoolife.com)
- [Jim Jones](https://github.com/aantix)
- [Sławek](https://github.com/sbogutyn)
- [Alex Weidmann](https://github.com/effektz)
- [David Gil](https://github.com/dgilperez)[Michael Grosser](http://grosser.it)
[email protected]
License: MIT
[![Build Status](https://travis-ci.org/grosser/youtube_search.png)](https://travis-ci.org/grosser/youtube_search)