|
|
Drest?
Drest is a Java API for popular web services. At the moment it supports Bloglines, Twitter and YouTube services.
Drest requires JDK 5.0.
The current release of drest: download
if you need help or anything, we have a google group: http://groups.google.com/group/drest-users
Purpose
The purpose of Drest is to make it easier to incorporate different APIs in use today. The supported APIs all have their own Service class, which means retrieving the details of a random featured movie on YouTube is as simple as this:
String developerId = 'get_your_developer_id_at_youtube.com';
// Create a service object
YouTubeService service = new YouTubeService(developerId);
// Get the details of the featured videos
List<YouTubeVideo> videoList = service.getFeaturedVideos();
// We'll have a shot at the first featured video
YouTubeVideo video = videoList.get(0);
// Print out the details
System.out.println('Video: ' + video.getTitle() + ' (length: ' + video.getLengthInSeconds() + ')');
System.out.println('\tURL: ' + video.getThumbnailUrl());
System.out.println('\tDescription: ' + video.getDescription());Read on for more example code.
Example code
Each service has a corresponding example which can be invoked from the command line.
Projects using Drest
CastCluster - uses Drest to fetch YouTube video details so they can be packaged as podcast feeds.
