Examples of YouTubeQuery


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

    int startIndex = 1;
    if (page != 1) {
      startIndex = itemPerPage * page;
    }
    try {
      YouTubeQuery query = new YouTubeQuery(new URL(
          "https://gdata.youtube.com/feeds/api/standardfeeds/top_favorites?time="
              + time + "&start-index=" + startIndex
              + "&max-results=" + itemPerPage
              + "&orderby=viewCount&v=2"));
      VideoFeed videoFeed = service.query(query, VideoFeed.class);
View Full Code Here

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

    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
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.