Results 1 to 5 of 5
  1. #1
    Jman85 is offline Member
    Join Date
    Nov 2010
    Posts
    14
    Rep Power
    0

    Default Youtube API - retrieve video on user input

    Hello,

    I was wandering if anyone has experience in using the Youtube API, I want to make it so if a user types "cat" it retrieves one video about cats... The user input will be string variable.

    I'm looking here
    Developer's Guide: Data API Protocol – Retrieving Data for a Single Video - YouTube APIs and Tools - Google Code

    and I am just completely puzzled.

    thankyou.
    PS, this is for my chatbot I have setup.

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    Do you have the socket framework set up to send/receive data to the API?

    If not, you will want to do some research into these type of sockets.

  3. #3
    Jman85 is offline Member
    Join Date
    Nov 2010
    Posts
    14
    Rep Power
    0

    Default

    If you are implying "Do you receive messages from users on the chat site" then yes, everything is setup.

    I can store a users input into a string variable, just one word they type, I can store it in a youtube_Userkeyword.

    I am looking here; http://code.google.com/apis/youtube/...uide_java.html but I am not sure which one best suits mine. I am also looking at this http://www.ibm.com/developerworks/xm.../x-youtubeapi/ thats a PHP example, looking at "Listing 6 and Listing 7", thought I just want the link of the video.
    Last edited by Jman85; 11-11-2010 at 04:12 AM.

  4. #4
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    No, I'm not asking about the server-client chat sockets. I'm asking about the API sockets to send data from your server to the YouTube server and receive data back from it.

    But since you have those links, that makes life real easy. For the first link, since you're searching videos, you want this section. You will then get a service feed back (or so the documentation implies) that will contain numerous bits of data about each video. There's a few links there on the feeds and their purpose.

  5. #5
    Jman85 is offline Member
    Join Date
    Nov 2010
    Posts
    14
    Rep Power
    0

    Default

    ahh ok, will go through it after, but while your viewing this thread could you please tell me how to convert JSON to a String variable so I can read it.

    At the moment, I don't at the moment have the link, but it looks something like this;
    http://www.urbandictionary.com/iphon..._json?term=jad
    anyways, I stored it in a String variable and then .toString(); it, but when I output it or check what it contains it shows [][][][][][][][][][][][][][]. And I know the json has something in it because I opened it up in notepad, at the moment I am reading about json etc. but would like some input how I can store it as a string to view and read.

Similar Threads

  1. youtube Video downloads
    By Gloomy in forum New To Java
    Replies: 2
    Last Post: 09-06-2010, 05:40 AM
  2. embed the video in the html page by youtube api
    By javastuden in forum Advanced Java
    Replies: 6
    Last Post: 06-17-2010, 01:23 PM
  3. download youtube video
    By lalit.wientech in forum Networking
    Replies: 11
    Last Post: 03-24-2010, 04:30 PM
  4. Replies: 2
    Last Post: 06-17-2009, 11:24 AM
  5. Replies: 1
    Last Post: 04-22-2008, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •