use of org.apache.http.client.utils.URIBuilder in project jabref by JabRef.
the class CrossRef method getURLForEntry.
@Override
public URL getURLForEntry(BibEntry entry) throws URISyntaxException, MalformedURLException, FetcherException {
URIBuilder uriBuilder = new URIBuilder(API_URL);
entry.getLatexFreeField(FieldName.TITLE).ifPresent(title -> uriBuilder.addParameter("query.title", title));
entry.getLatexFreeField(FieldName.AUTHOR).ifPresent(author -> uriBuilder.addParameter("query.author", author));
entry.getLatexFreeField(FieldName.YEAR).ifPresent(year -> uriBuilder.addParameter("filter", "from-pub-date:" + year));
// = API default
uriBuilder.addParameter("rows", "20");
// start at beginning
uriBuilder.addParameter("offset", "0");
return uriBuilder.build().toURL();
}
use of org.apache.http.client.utils.URIBuilder in project jabref by JabRef.
the class DiVA method getURLForID.
@Override
public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException {
URIBuilder uriBuilder = new URIBuilder("http://www.diva-portal.org/smash/getreferences");
uriBuilder.addParameter("referenceFormat", "BibTex");
uriBuilder.addParameter("pids", identifier);
return uriBuilder.build().toURL();
}
use of org.apache.http.client.utils.URIBuilder in project jabref by JabRef.
the class AstrophysicsDataSystem method getURLForQuery.
@Override
public URL getURLForQuery(String query) throws URISyntaxException, MalformedURLException, FetcherException {
URIBuilder uriBuilder = getBaseUrl(API_QUERY_URL);
uriBuilder.addParameter("qsearch", query);
return uriBuilder.build().toURL();
}
use of org.apache.http.client.utils.URIBuilder in project jabref by JabRef.
the class AstrophysicsDataSystem method getURLForID.
@Override
public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException {
String key = identifier.replaceAll(patternRemoveDOI, "");
URIBuilder uriBuilder = new URIBuilder(API_DOI_URL + key);
uriBuilder.addParameter("data_type", "BIBTEXPLUS");
return uriBuilder.build().toURL();
}
use of org.apache.http.client.utils.URIBuilder in project jabref by JabRef.
the class zbMATH method getURLForQuery.
/**
* TODO: Implement EntryBasedParserFetcher
* We use the zbMATH Citation matcher (https://www.zbmath.org/citationmatching/)
* instead of the usual search since this tool is optimized for finding a publication based on partial information.
*/
/*
@Override
public URL getURLForEntry(BibEntry entry) throws URISyntaxException, MalformedURLException, FetcherException {
// Example: https://zbmath.org/citationmatching/match?q=Ratiu
}
*/
@Override
public URL getURLForQuery(String query) throws URISyntaxException, MalformedURLException, FetcherException {
URIBuilder uriBuilder = new URIBuilder("https://zbmath.org/bibtexoutput/");
// search all fields
uriBuilder.addParameter("q", query);
// start index
uriBuilder.addParameter("start", "0");
// should return up to 200 items (instead of default 100)
uriBuilder.addParameter("count", "200");
URLDownload.bypassSSLVerification();
return uriBuilder.build().toURL();
}
Aggregations