Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 2.18 KB

README.md

File metadata and controls

81 lines (55 loc) · 2.18 KB

jiphy

Apache License Build Status Maven Central Coverage Status Code Climate PRs Welcome

🎥 jiphy - Java Wrapper for Giphy API

Usage

Download the latest release JAR or grab via Maven:

<dependency>
  <groupId>org.brunocvcunha.jiphy</groupId>
  <artifactId>jiphy</artifactId>
  <version>1.0</version>
</dependency>

or Gradle:

compile 'org.brunocvcunha.jiphy:jiphy:1.0'

Supported Operations & Examples

Initialize

Jiphy jiphy = Jiphy.builder()
    .apiKey(JiphyConstants.API_KEY_BETA)
    .build();

Search

JiphySearchResponse cats = jiphy.sendRequest(new JiphySearchRequest("cats"));

for (JiphyGif gif : cats.getData()) {
    System.out.println("Cat: " + gif.getUrl());
}

Trending

JiphySearchResponse trending = jiphy.sendRequest(new JiphyTrendingRequest());

Translate

JiphySearchResponse superman = jiphy.sendRequest(new JiphyTranslateRequest("superman"));

Upload

JiphyUploadResult upload = jiphy.sendRequest(new JiphyUploadRequest(new File("/path/to/cats.gif")));
System.out.println("Uploaded, id: " + upload.getData().getId());

Snapshots of the development version are available in Sonatype's snapshots repository.

jiphy requires at minimum Java 8.