Socket
Socket
Sign inDemoInstall

net.joningi:icndb-java-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

net.joningi:icndb-java-api

Java API client for The Internet Chuck Norris Database (http://www.icndb.com/)


Version published
Maintainers
1
Source

icndb-java-api

Overview

Java API client for The Internet Chuck Norris Database (http://www.icndb.com/)

Usage

Init

Everyting depend on ICNDBClient client object

import net.joningi.icndb.ICNDBClient;

....

final ICNDBClient client = new ICNDBClient();

Get single joke by ID

import net.joningi.icndb.Joke;

...

Joke joke = client.getById(15);
System.out.println(joke.getId() + ": " + joke.getJoke());

Get single random joke

Joke randomJoke = client.getRandom();

Get n random joke

for (Joke j : client.getRandom(10)) {
	System.out.println(j.getId() + ": " + j.getJoke());
}

Changing the name of the main character

client.setFirstName("Bill");
client.setLastName("Clinton");

Joke randomJoke = client.getRandom();

client.clearName();

Fetching the number of jokes

System.out.println(client.getCount());

Fetching the list of joke categories

for (String category : client.getCategories()) {
	System.out.println(category);
}

Limiting categories

client.setExclude(Lists.newArrayList("explicit", "nerdy"));
Joke randomJoke = client.getRandom();
client.clearLimitAndExclude();

client.setLimitTo(Lists.newArrayList("explicit", "nerdy"));
Joke randomJoke = client.getRandom();
client.clearLimitAndExclude();

FAQs

Package last updated on 11 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc