My favorites | Sign in
Project Logo
                
Show all Featured downloads:
javascribd-0.1.1.zip
People details
Project owners:
  m...@marcel-eyke.de
Project committers:
mkarneim

Javascribd is the Java client library for the Scribd API.

It allows you to write Java applications that connect to the REST-based Scribd API.

login sample

ScribdClient client = new ScribdClient();

ApiKey apiKey = new ApiKey("scripd_api_key");
String username = "username";
String password = "password";

Login login = new Login(apiKey, username, password);

LoginResponse response = client.execute(login);

SessionKey sessionKey = response.getSessionKey();

see the full source on LoginSnippet

search sample

ScribdClient client = new ScribdClient();

ApiKey apiKey = new ApiKey("scripd_api_key");
String query = "java";

Search search = new Search(apiKey, query);
search.setScope(SearchScope.ALL);

SearchResponse response = client.execute(search);

for (SearchResponse.Entry result : response.getResultSet().getEntries()) {
  System.out.printf("%d - %s\n", result.getDocId().intValue(), result.getTitle());
}

see the full source on SearchSnippet

upload sample

ScribdClient client = new ScribdClient();

ApiKey apiKey = new ApiKey("scripd_api_key");
File file = new File("example.pdf");
StreamableData uploadData = new FileData(file);

Upload upload = new Upload(apiKey, uploadData);
upload.setDocType("pdf");
upload.setAccess(Access.PRIVATE);

UploadResponse response = client.execute(upload);

System.out.printf("document_id: %d\n", response.getDocId().intValue());
System.out.printf("document_id: %s\n", response.getAccessKey());

see the full source on UploadSnippet









Hosted by Google Code