Examples of VideoFeed


Examples of com.google.gdata.data.youtube.VideoFeed

    boolean result = false;
    try {
      System.out.println("Checking channel...");
      String feedUrl = "http://gdata.youtube.com/feeds/api/videos?author="
          + channel;
      VideoFeed feed = service.getFeed(new URL(feedUrl), VideoFeed.class);
      if (feed.getEntries().size() > 0) {
        result = true;
      }
    } catch (Exception e) {
      log.warning(e.toString());
      e.printStackTrace();
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

   * @throws IOException Error sending request or reading the feed.
   * @throws ServiceException If the service is unable to handle the request.
   */
  private static void printVideoFeed(YouTubeService service, String feedUrl)
      throws IOException, ServiceException {
    VideoFeed videoFeed = service.getFeed(new URL(feedUrl), VideoFeed.class);
    String title = videoFeed.getTitle().getPlainText();

    printUnderlined(title);
    List<VideoEntry> videoEntries = videoFeed.getEntries();
    if (videoEntries.size() == 0) {
      System.out.println("This feed contains no entries.");
      return;
    }
    int count = 1;
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

  private void printVideos(YouTubeService service)
      throws IOException, ServiceException {

    Query query = new Query(new URL(UPLOADS_URL));
    query.setFields("title,entry(title, media:group/media:player)");
    VideoFeed videoFeed = service.query(query, VideoFeed.class);

    output.println(videoFeed.getTitle() + ":");
    int count = 1;
    for (VideoEntry entry : videoFeed.getEntries()) {
      output.println(count + ") "
          + entry.getTitle().getPlainText() + ": "
          + entry.getMediaGroup().getPlayer().getUrl());
    }
  }
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

    List<Text> listTube = new ArrayList<Text>();
    List<Tube> listSave2DB = new ArrayList<Tube>();
    String feedUrl = "http://gdata.youtube.com/feeds/api/users/" + alias
        + "/uploads";
    service.setConnectTimeout(2000);
    VideoFeed videoFeed;
    try {
      videoFeed = service.getFeed(new URL(feedUrl), VideoFeed.class);
      for (VideoEntry videoEntry : videoFeed.getEntries()) {
        Tube tub = new Tube();
        tub.transformHalfVideoEntry(videoEntry);
        tub.setStatus(2);
        tub.setUpdated(Calendar.getInstance().getTime());
        listTube.add(new Text(tub.toString()));
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

   *                     If the service is unable to handle the request.
   * @throws IOException error sending request or reading the feed.
   */
  private static void printVideoFeed(YouTubeService service, String feedUrl,
      boolean showCommentsAndResponses) throws IOException, ServiceException {
    VideoFeed videoFeed = service.getFeed(new URL(feedUrl), VideoFeed.class);
    String title = videoFeed.getTitle().getPlainText();
    if (showCommentsAndResponses) {
      title += " with comments and responses";
    }
    printUnderlined(title);
    List<VideoEntry> videoEntries = videoFeed.getEntries();
    if (videoEntries.size() == 0) {
      System.out.println("This feed contains no entries.");
      return;
    }
    int count = 1;
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

    String searchTerms = readLine();

    query.setFullTextQuery(searchTerms);

    printUnderlined("Running Search for '" + searchTerms + "'");
    VideoFeed videoFeed = service.query(query, VideoFeed.class);
    for (VideoEntry ve : videoFeed.getEntries()) {
      printVideoEntry("", ve, false);
    }
    System.out.println();
  }
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

    // adds the collection of keyword categories to the query
    query.addCategoryFilter(categoryFilter);

    printUnderlined("Running Search for '" + allKeywords + "'");
    VideoFeed videoFeed = service.query(query, VideoFeed.class);
    for (VideoEntry ve : videoFeed.getEntries()) {
      printVideoEntry("", ve, false);
    }
    System.out.println();
  }
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

          "https://gdata.youtube.com/feeds/api/videos"));
      query.setFullTextQuery(key);
      query.setMaxResults(itemPerPage);
      query.setStartIndex(itemPerPage * page);
      query.setSafeSearch(YouTubeQuery.SafeSearch.NONE);
      VideoFeed videoFeed = service.query(query, VideoFeed.class);
      result.setTotalResult(videoFeed.getTotalResults());
      result.setCurrentPage(page);
      List<Tube> listSave2DB = new ArrayList<Tube>();
      for (VideoEntry videoEntry : videoFeed.getEntries()) {
        Tube tub = new Tube();
        tub.transformHalfVideoEntry(videoEntry);
        tub.setStatus(2);
        tub.setUpdated(Calendar.getInstance().getTime());
        listTube.add(tub);
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

      YouTubeQuery query = new YouTubeQuery(new URL(
          "https://gdata.youtube.com/feeds/api/standardfeeds/most_viewed?time="
              + time + "&start-index=" + startIndex
              + "&max-results=" + itemPerPage
              + "&orderby=viewCount&v=2"));
      VideoFeed videoFeed = service.query(query, VideoFeed.class);
      result.setTotalResult(videoFeed.getTotalResults());
      result.setCurrentPage(page);
      List<VideoEntry> videos = videoFeed.getEntries();
      for (VideoEntry videoEntry : videos) {
        Tube tub = new Tube();
        tub.transformHalfVideoEntry(videoEntry);
        tub.setStatus(2);
        tub.setUpdated(Calendar.getInstance().getTime());
View Full Code Here

Examples of com.google.gdata.data.youtube.VideoFeed

    List<Tube> listSave2DB = new ArrayList<Tube>();
    try {
      YouTubeQuery query = new YouTubeQuery(new URL(
          "https://gdata.youtube.com/feeds/api/standardfeeds/most_popular?time="
              + time + "&max-results=6&orderby=viewCount&v=2"));
      VideoFeed videoFeed = service.query(query, VideoFeed.class);
      List<VideoEntry> videos = videoFeed.getEntries();
      for (VideoEntry videoEntry : videos) {
        Tube tub = new Tube();
        tub.transformHalfVideoEntry(videoEntry);
        tub.setStatus(2);
        tub.setUpdated(Calendar.getInstance().getTime());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.