Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Guck mal hier: HtmlUnit - Welcome to HtmlUnit
Etwas leichtgewichtiger würde es vielleicht auch mit HttpURLConnection-Rumgefummel und einem HTML-Parser gehen ... [/url]
Ark
?varname1=wert1&varname2=wert2
import com.google.api.client.googleapis.services.GoogleKeyInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson.JacksonFactory;
import com.google.api.services.books.Books;
import com.google.api.services.books.model.Volume;
import com.google.api.services.books.model.Volumes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class GoogleBooks {
private Books booksApi;
public GoogleBooks(String key) {
JsonFactory jf = new JacksonFactory();
// das Objekt für die Abfrage bauen -- key ist dann natürlich Dein API-Key
booksApi = Books.builder(new NetHttpTransport(), jf).setJsonHttpRequestInitializer(new GoogleKeyInitializer(key)).build();
}
private List<BookResult> resultFromQuery() {
try {
//Query für die Abfrage bauen als z.B. "isbn:9783897214217"
String query = "isbn:" + isbn;
List<BookResult> resultList = new ArrayList<BookResult>();
List<Volume> volumeList = new ArrayList<Volume>();
Books.Volumes.List list = booksApi.volumes().list(query);
Volumes volumes = list.execute();
if (volumes.getTotalItems() > 0) {
//die Liste füllen
volumeList = volumes.getItems();
}
if (volumeList != null && !volumeList.isEmpty()) {
//die Liste durchnudeln
for (Volume v : volumeList) {
//Objekt einer Klasse erzeugen, die die Ergebnisse sammelt (als Beispiel)
BookResult bookResult = new BookResult();
bookResult.setTitle( v.getVolumeInfo().getTitle());
bookResult.setPublisher(v.getVolumeInfo().getPublisher());
resultList.add(bookResult);
}
}
return resultList;
} catch (IOException e) {
e.printStackTrace();
return Collections.emptyList();
}
}
http://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query=NUM%3D9783834805690&recordSchema=MARC21-xml&accessToken=xxXXxxXXxxXXxxXX
String buchFile = new String(sruAbfrage);