当前位置: 首页>>代码示例>>Java>>正文


Java UserFeed类代码示例

本文整理汇总了Java中com.google.gdata.data.photos.UserFeed的典型用法代码示例。如果您正苦于以下问题:Java UserFeed类的具体用法?Java UserFeed怎么用?Java UserFeed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UserFeed类属于com.google.gdata.data.photos包,在下文中一共展示了UserFeed类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAlbums

import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
 * Retrieves the albums for the given user.
 */
public List<AlbumEntry> getAlbums(String username) throws IOException,
    ServiceException {

  String albumUrl = API_PREFIX + username;
  UserFeed userFeed = getFeed(albumUrl, UserFeed.class);

  List<GphotoEntry> entries = userFeed.getEntries();
  List<AlbumEntry> albums = new ArrayList<AlbumEntry>();
  for (GphotoEntry entry : entries) {
    GphotoEntry adapted = entry.getAdaptedEntry();
    if (adapted instanceof AlbumEntry) {
      albums.add((AlbumEntry) adapted);
    }
  }
  return albums;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:20,代码来源:PicasawebClient.java

示例2: getTags

import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
 * Retrieves the tags for the given user.  These are tags aggregated across
 * the entire account.
 */
public List<TagEntry> getTags(String uname) throws IOException,
    ServiceException {
  String tagUrl = API_PREFIX + uname + "?kind=tag";
  UserFeed userFeed = getFeed(tagUrl, UserFeed.class);

  List<GphotoEntry> entries = userFeed.getEntries();
  List<TagEntry> tags = new ArrayList<TagEntry>();
  for (GphotoEntry entry : entries) {
    GphotoEntry adapted = entry.getAdaptedEntry();
    if (adapted instanceof TagEntry) {
      tags.add((TagEntry) adapted);
    }
  }
  return tags;
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:20,代码来源:PicasawebClient.java

示例3: getTags

import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
 * Retrieves the tags for the given user.  These are tags aggregated across
 * the entire account.
 */
public List<TagEntry> getTags(String uname) throws IOException,
        ServiceException {
    String tagUrl = API_PREFIX + uname + "?kind=tag";
    UserFeed userFeed = getFeed(tagUrl, UserFeed.class);

    List<GphotoEntry> entries = userFeed.getEntries();
    List<TagEntry> tags = new ArrayList<TagEntry>();
    for (GphotoEntry entry : entries) {
        GphotoEntry adapted = entry.getAdaptedEntry();
        if (adapted instanceof TagEntry) {
            tags.add((TagEntry) adapted);
        }
    }
    return tags;
}
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:20,代码来源:PicasawebClient.java

示例4: declareExtensions

import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
 * Declare the extensions of the feeds for the Picasa Web Albums Data API.
 */
private void declareExtensions() {
  extProfile.setAutoExtending(true);
  new AlbumEntry().declareExtensions(extProfile);
  new AlbumFeed().declareExtensions(extProfile);
  new CommentEntry().declareExtensions(extProfile);
  new PhotoEntry().declareExtensions(extProfile);
  new PhotoFeed().declareExtensions(extProfile);
  new TagEntry().declareExtensions(extProfile);
  new UserEntry().declareExtensions(extProfile);
  new UserFeed().declareExtensions(extProfile);
}
 
开发者ID:google,项目名称:gdata-java-client,代码行数:15,代码来源:PicasawebService.java

示例5: getAllImage

import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
public List<String> getAllImage()
{
    String userName ="YOUR GOOGLE PICASA USERNAME";
    String password = "YOUR GOOGLE PICASA PASSWORD";
    System.out.println("Inside getallimage");
    PicasawebService myService = new PicasawebService("exampleCo-exampleApp-1");
    List<String> listUrl = new LinkedList<String>();
    try
    {
        myService.setUserCredentials(userName, password);
        URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/"+userName+"?kind=album");

        UserFeed myUserFeed = myService.getFeed(feedUrl, UserFeed.class);

        String id = "";
        List<AlbumEntry> albumEntries = myUserFeed.getAlbumEntries();
        System.out.println(albumEntries.isEmpty());
        AlbumEntry myAlbum = albumEntries.get(1);
            id = myAlbum.getGphotoId();
            System.out.println(id);
            //System.out.println(service.parseURL(id));


        System.out.println("UserName :"+userName);
        URL albumUrl = new URL("https://picasaweb.google.com/data/feed/api/user/"+userName+"/albumid/"+parseURL(id));
        System.out.println(albumUrl.toString());
        AlbumFeed feed = myService.getFeed(albumUrl, AlbumFeed.class);


        for(PhotoEntry photo : feed.getPhotoEntries()) {
            System.out.println("Photos");
            String photoUrl = photo.getTitle().getPlainText();
            System.out.println(parsePhotoUrl(photo.getMediaThumbnails().get(0).getUrl()));
            listUrl.add(parsePhotoUrl(photo.getMediaThumbnails().get(0).getUrl()));
        }
    }catch (Exception e)
    {
        e.printStackTrace();
    }
    
    System.out.println("Returning listUrl");
    return listUrl;
}
 
开发者ID:Anilshrestha,项目名称:Incredible-Earth-Space-APP-Challenge-,代码行数:44,代码来源:ImageService.java

示例6: getAlbums

import com.google.gdata.data.photos.UserFeed; //导入依赖的package包/类
/**
 * Retrieves the albums for the given user.
 * albumUrl = addParameter(albumUrl, "hidestreamid", "photos_from_posts" );
 */
public List getAlbums(String username, Boolean showall ) throws IOException, ServiceException {
    
    String albumUrl = API_PREFIX + username;

    if( showall )
        albumUrl = addParameter( albumUrl, "showall", null );

    List<GphotoEntry> albums = new ArrayList<GphotoEntry>();

    while( true ) {
    	UserFeed userFeed = getFeed(albumUrl, UserFeed.class);

        feeds.add( userFeed );

        List<GphotoEntry> entries = userFeed.getEntries();

        for (GphotoEntry entry : entries) {            	
        	albums.add(entry);
        }

        Link nextLink = userFeed.getNextLink();
        if( nextLink == null )
            break;

        albumUrl = nextLink.getHref();
    }

    TimeUtils.sortGPhotoEntriesNewestFirst( albums );
    return albums;
}
 
开发者ID:Dotosoft,项目名称:dotoquiz-tools,代码行数:35,代码来源:PicasawebClient.java


注:本文中的com.google.gdata.data.photos.UserFeed类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。