Package com.google.gdata.client.youtube

Examples of com.google.gdata.client.youtube.YouTubeService


    if (help || username == null || password == null || developerKey == null) {
      printUsage();
      System.exit(1);
    }

    YouTubeService service = new YouTubeService("gdata-YTPartialDemo-1",
        developerKey);

    try {
      service.setUserCredentials(username, password);
    } catch (AuthenticationException e) {
      System.out.println("Invalid login credentials.");
      System.exit(1);
    }
View Full Code Here


    if (help || username == null || password == null || developerKey == null) {
      printUsage();
      System.exit(1);
    }

    YouTubeService service = new YouTubeService("gdataSample-YouTubeAuth-1",
        developerKey);

    try {
      service.setUserCredentials(username, password);
    } catch (AuthenticationException e) {
      System.out.println("Invalid login credentials.");
      System.exit(1);
    }
View Full Code Here

   * the Java Client library.
   *
   * @param args not used
   */
  public static void main(String[] args) {
    YouTubeService myService = new YouTubeService("gdataSample-YouTube-1");

    while (true) {
      try {
        printUsage();
        int choice = readInt();
View Full Code Here

    if (help || username == null || password == null || developerKey == null) {
      printUsage();
      System.exit(1);
    }

    YouTubeService service = new YouTubeService("gdataSample-YouTubeAuth-1",
        developerKey);

    try {
      service.setUserCredentials(username, password);
    } catch (AuthenticationException e) {
      System.out.println("Invalid login credentials.");
      System.exit(1);
    }
View Full Code Here

    }

    private static YouTubeVideo retrieveVideo(String clientID, String keywords,
            int timeout, String ip) throws IOException, ServiceException {

        YouTubeService service = new YouTubeService(clientID);
        service.setConnectTimeout(timeout); // millis
        YouTubeQuery query = new YouTubeQuery(new URL(YOUTUBE_URL));

        query.setOrderBy(YouTubeQuery.OrderBy.RELEVANCE);
        query.setFullTextQuery(keywords);
        query.setMaxResults(1);
        query.setFormats(5);
        if (!ip.equals(""))
            query.setIpRestriction(ip);
        query.setSafeSearch(YouTubeQuery.SafeSearch.MODERATE);

        VideoFeed videoFeed = service.query(query, VideoFeed.class);
        List<VideoEntry> videos = videoFeed.getEntries();

        return convertVideos(videos);

    }
View Full Code Here

TOP

Related Classes of com.google.gdata.client.youtube.YouTubeService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.