I want to implement a WebService to access a PicasaPhotoAlbum. But I have following problem:
I have following URL:
URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/466601293793610730264/album/Testalbum?tag=Test");
This does not work. But when I delete "?tag=Test" and the URL looks like this:
URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/use/466601293793610730264/album/Testalbum");
the code works perfect. The thing is, I only want to have the pictures with a special tag. Can someone explain me why this does not work with "?tag=Test".
My whole code is (I use the picasa API version 2.0):
public class RaceDriverImport implements IRaceDriverService {
PicasawebService myService = new PicasawebService("TestIt");
public RaceDriverImport() throws AuthenticationException {
myService.setUserCredentials("test.picasa@gmail.com", "99thisisabadpw77");
}
@Override
public List<RaceDriver> getRaceDrivers() throws IOException, ServiceException {
URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/466601293793610730264/album/Testalbum?tag=Test");
AlbumFeed feed = myService.getFeed(feedUrl, AlbumFeed.class);
for (PhotoEntry photo : feed.getPhotoEntries()) {
System.out.println(photo.getTitle().getPlainText());
}
List<RaceDriver> drivers = null;
return drivers;
}
You do not say which version you are using, but for version 2.0 you do it this way:
URL feedUrl = new URL("https://picasaweb.google.com/data/feed/api/user/466601293793610730264/album/Testalbum");
Query myQuery = new Query(feedUrl);
myQuery.setStringCustomParameter("kind", "photo");
myQuery.setStringCustomParameter("tag", "test");
etc..
Reference: https://developers.google.com/picasa-web/docs/2.0/developers_guide_java#SearchByTags