{"id":16147413,"url":"https://github.com/edap/yourub","last_synced_at":"2025-07-27T18:04:10.173Z","repository":{"id":11294498,"uuid":"13707668","full_name":"edap/yourub","owner":"edap","description":"Yourub is a gem that search videos on youtube using the YouTube API v3.","archived":false,"fork":false,"pushed_at":"2016-09-05T11:26:57.000Z","size":118,"stargazers_count":17,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T23:17:18.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rderoldan1/usagewatch_ext","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-19T19:51:03.000Z","updated_at":"2022-04-21T22:07:22.000Z","dependencies_parsed_at":"2022-09-08T21:50:26.466Z","dependency_job_id":null,"html_url":"https://github.com/edap/yourub","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2Fyourub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2Fyourub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2Fyourub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2Fyourub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edap","download_url":"https://codeload.github.com/edap/yourub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945478,"owners_count":20372894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T00:25:13.745Z","updated_at":"2025-03-18T18:31:42.526Z","avatar_url":"https://github.com/edap.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/yourub.svg)](http://badge.fury.io/rb/yourub)\n[![Dependency Status](https://gemnasium.com/edap/yourub.svg)](https://gemnasium.com/edap/yourub)\n[![Build Status](https://travis-ci.org/edap/yourub.svg?branch=master)](https://travis-ci.org/edap/yourub)\n[![Code Climate](https://codeclimate.com/github/edap/yourub.png)](https://codeclimate.com/github/edap/yourub)\n\n# Yourub\nYourub is a gem that search videos on youtebe using the YouTube API v3.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'yourub'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install yourub\n\n## Usage\n\nGet a developer key as explained [here](http://www.youtube.com/watch?v=Im69kzhpR3I)\nAfter that, you have 2 ways to use the client. If you want to use it in your\nrails app,  create a app/config/yourub.yml file as follow:\n```\nyourub_defaults: \u0026yourub_defaults\n  developer_key: 'YoUrDevEl0PerKey'\n  youtube_api_service_name: 'youtube'\n  youtube_api_version: 'v3'\n  application_name: \"yourub\"\n  application_version: \"0.1\"\n  log_level: WARN\n\ndevelopment:\n  \u003c\u003c: *yourub_defaults\n\nproduction:\n  \u003c\u003c: *yourub_defaults\n\ntest:\n  \u003c\u003c: *yourub_defaults\n```\n\nIf you want to use it from the console, or in another program, you can simply\npass an hash containing the needed options\n```ruby\noptions = { developer_key: 'mySecretKey',\n             application_name: 'yourub',\n             application_version: 2.0,\n             log_level: 3 }\n\nclient = Yourub::Client.new(options)\n```\n\n\n### Examples\n\nFor example, to find the most recent videos in the category \"sports\" in Germany\n```ruby\nclient = Yourub::Client.new\nclient.search(country: \"DE\", category: \"sports\", order: 'date') do |v|\n  puts v\nend\n```\n\nTo find video for a specific thema, use the parameter query\n\n```ruby\nclient = Yourub::Client.new\nclient.search(query: \"aliens\") do |v|\n  puts v\nend\n```\nthat is the content of the response:\n```\n[{\"kind\"=\u003e\"youtube#video\", \"etag\"=\u003e\"\\\"N5Eg36Gl054SUNiWWc-Su3t5O-k/U6AzLXvcnZt2WFqpnq9_dksV7DA\\\"\", \"id\"=\u003e\"NisCkxU544c\", \"snippet\"=\u003e{\"publishedAt\"=\u003e\"2009-04-05T05:20:10.000Z\", \"channelId\"=\u003e\"UCCHcEUksSVKsRDH86j77Ntg\", \"title\"=\u003e\"Like A Boss (ft. Seth Rogen) - Uncensored Version\", \"description\"=\u003e\"http://www.itunes.com/thelonelyisland\\r\\n\\r\\nThe new single from The Lonely Island's debut album \\\"INCREDIBAD\\\" In stores now!\\r\\n\\r\\nFeaturing Seth Rogen.\\r\\n\\r\\nThe Lonely Island is Andy Samberg, Akiva Schaffer \u0026 Jorma Taccone.\", \"thumbnails\"=\u003e{\"default\"=\u003e{\"url\"=\u003e\"https://i1.ytimg.com/vi/NisCkxU544c/default.jpg\", \"width\"=\u003e120, \"height\"=\u003e90}, \"medium\"=\u003e{\"url\"=\u003e\"https://i1.ytimg.com/vi/NisCkxU544c/mqdefault.jpg\", \"width\"=\u003e320, \"height\"=\u003e180}, \"high\"=\u003e{\"url\"=\u003e\"https://i1.ytimg.com/vi/NisCkxU544c/hqdefault.jpg\", \"width\"=\u003e480, \"height\"=\u003e360}, \"standard\"=\u003e{\"url\"=\u003e\"https://i1.ytimg.com/vi/NisCkxU544c/sddefault.jpg\", \"width\"=\u003e640, \"height\"=\u003e480}, \"maxres\"=\u003e{\"url\"=\u003e\"https://i1.ytimg.com/vi/NisCkxU544c/maxresdefault.jpg\", \"width\"=\u003e1280, \"height\"=\u003e720}}, \"channelTitle\"=\u003e\"thelonelyisland\", \"categoryId\"=\u003e\"23\", \"liveBroadcastContent\"=\u003e\"none\"}, \"statistics\"=\u003e{\"viewCount\"=\u003e\"120176425\", \"likeCount\"=\u003e\"594592\", \"dislikeCount\"=\u003e\"15121\", \"favoriteCount\"=\u003e\"0\", \"commentCount\"=\u003e\"208109\"}}]\n```\n### Available parameters\n`:query` String, example `aliens`\n\n`:country` String, one or more alpha-2 country codes [ISO 3166-1](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm), example `US` or `IT, DE`. The default one is `US`\n\n`:category` String, example `comedy`. It accept the wildcard `all`, that retrieves videos for all the category for the given nation, or the default one (US) if no one is given\n\n`:count_filter` Hash, example `{views: \"\u003e= 100\"}` or `{views: \"== 600\"}`\n\n`:max_results` Integer, between 1 and 50\n\n`:order` String, one of these: 'date', 'rating', 'relevance', 'title', 'videocount', 'viewcount'. The default one is `'relevance'`\n\nIt's necessary at least one of this parameters to start a search: `:country`, `:category`, `:query`\n \n### Methods\n* `search`, search youtube videos for the given parameters\n```ruby\nclient = Yourub::Client.new\nclient.search(query: \"space missions\")\n```\n\n* `get_views`\nit return the number of views for the given video id\n```ruby\nclient = Yourub::Client.new\nclient.get_views(\"G2b0OIkTraI\")\n```\n* `get`\nretrieves all the metatags available for one\n```ruby\nclient = Yourub::Client.new\nclient.get(\"G2b0OIkTraI\")\n```\n\n## Supported Ruby Versions\nThis gem [supports](https://travis-ci.org/edap/yourub) the following Ruby versions:\n\n* Ruby 1.9.3\n* Ruby 2.0.0\n* Ruby 2.1\n* Ruby 2.2\n* JRuby 1.7 (in Ruby 1.9 mode)\n\n##TODO\nHere there is a [list](https://developers.google.com/youtube/v3/docs/) of the available methods.\nCurrently, this gem implements: [videos.list](https://developers.google.com/youtube/v3/docs/videos/list), [search.list](https://developers.google.com/youtube/v3/docs/search/list) and [videoCategories.list](https://developers.google.com/youtube/v3/docs/videoCategories/list).\nThe next methods that will be implemented are [playlist.list](https://developers.google.com/youtube/v3/docs/playlists/list) and [channelis.list](https://developers.google.com/youtube/v3/docs/channels/list)\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Run the test, run the spec/yourub/integration.rb file with a valid developer\n   key\n5. Push to the branch (`git push origin my-new-feature`)\n4. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedap%2Fyourub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedap%2Fyourub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedap%2Fyourub/lists"}