Package com.google.gdata.data.youtube

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


      if(lock.tryLock()) {
        try {
          log.debug("Retrieving activity for user " + username);
          String etag = db.getEtagForUser(username);
          String updated = db.getFeedUpdatedForUser(username);
          UserEventFeed activity = api.getActivityFeed(username, etag, updated);
          db.updateFeedUpdatedForUser(username, activity.getUpdated().toString());
          db.updateEtagForUser(username, activity.getEtag());
          db.updateUserActivities(activity);
          log.debug("Retrieved activity for user " + username);
        } catch (ApiException e) {
          log.error("Problem retrieving activity", e);
        } catch (DatabaseException e) {
View Full Code Here


    service = new YouTubeService(config.getClientId(), config.getDevKey());
  }

  public UserEventFeed getActivityFeed(String username, String etag, String publishedMin) throws ApiException, NotModifiedException {
   
    UserEventFeed feed = null;
   
    try {
      StringBuffer url = new StringBuffer(activityFeedUrlPrefix);
      url.append(username).append(activityFeedUrlSuffix);
      if(publishedMin != null) {
View Full Code Here

  public void getActiveByChannel(String channel) {
    try {
      listResult = new ArrayList<UserEventEntry>();
      String feedUrl = "http://gdata.youtube.com/feeds/api/events?author="
          + channel;
      UserEventFeed activityFeed = service.getFeed(new URL(feedUrl),
          UserEventFeed.class);

      for (UserEventEntry entry : activityFeed.getEntries()) {
        String user = entry.getAuthors().get(0).getName();
        if (entry.getUserEventType() == UserEventEntry.Type.VIDEO_UPLOADED) {
          listResult.add(entry);
          System.out.println(user + " uploaded a video "
              + entry.getVideoId());
View Full Code Here

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

    printUnderlined(title);
    if (activityFeed.getEntries().size() == 0) {
      System.out.println("This feed contains no entries.");
      return;
    }
    for (UserEventEntry entry : activityFeed.getEntries()) {
      String user = entry.getAuthors().get(0).getName();
      if(entry.getUserEventType() == UserEventEntry.Type.VIDEO_UPLOADED) {
        System.out.println(user + " uploaded a video " + entry.getVideoId());
      }
      else if(entry.getUserEventType() == UserEventEntry.Type.VIDEO_RATED) {
View Full Code Here

TOP

Related Classes of com.google.gdata.data.youtube.UserEventFeed

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.