Git Product home page Git Product logo

youtube-pairing-042219's Introduction

Ruby OO Youtube Example

Instructions

  • Run bundle install
  • Create a file called .env and add the following line:
  • API_KEY=paste_key_you_get_from_instructor
  • Run ruby example.rb from the console to see an example of what we will be building today (or visit this link)

Your goal is to use the example video to guide you. Check it to see what functionality your program should have.

What you start with

Wehn writing your own code in the run.rb file, you will be able to call one special method:

get_videos_from_youtube(keyword)

It's not necessary to know all of the inner workings of this method to be able to use it in our program! That's pretty cool!

You can use it like this:

  • pass it a string of the keyword you want to search youtube with.
  • Ex: get_videos_from_youtube("turtles")
  • It returns an Array of Video instances:
[
  <Video
  @link="https://www.youtube.com/watch?v=7c7Oz5yNGkE",
  @title="Catching Sea Turtles!">,
 <Video
  @link="https://www.youtube.com/watch?v=pH6bgPEh8yw",
  @title="Releasing the Turtles in the Outdoor Pond">,
 <Video
  @link="https://www.youtube.com/watch?v=jh9AyTer7bw",
  @title="MINI POOL Pond for BABY TURTLES!">,
 <Video
  @link="https://www.youtube.com/watch?v=2iXMGDym0pA",
  @title=
   "Red Eared Slider Turtle covering her nest and laying egg- Baby Turtle hatching">,
 <Video
  @link="https://www.youtube.com/watch?v=P2DI-57BDKo",
  @title="Moving ALL My TURTLES indoors...">
]

Video#open_in_browser

Video instances have link and title reader methods.

Video instances also have an open_in_browser method. Calling open_in_browser on an instance of the Video class will launch your web browser and open the video on youtube.

Again, we don't need to know all the inner workings of this method to correctly use it in our code. If you're interested in going deeper-- ask your instructor!

youtube-pairing-042219's People

Contributors

alexgriff avatar

Watchers

Kevin McAlear avatar  avatar Victoria Thevenot avatar Belinda Black avatar Bernard Mordan avatar  avatar Joe Cardarelli avatar Sara Tibbetts avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar Antoin avatar  avatar  avatar Amanda D'Avria avatar  avatar Scott Ungchusri avatar Nicole Kroese  avatar Lore Dirick avatar Lisa Jiang avatar Vicki Aubin avatar Maxwell Benton avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.