{"id":22173396,"url":"https://github.com/codeat3/icndb","last_synced_at":"2025-03-24T17:46:12.776Z","repository":{"id":56954872,"uuid":"258329259","full_name":"codeat3/icndb","owner":"codeat3","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-12T13:34:44.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T07:11:20.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeat3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-23T20:59:56.000Z","updated_at":"2021-03-12T13:34:12.000Z","dependencies_parsed_at":"2022-08-21T04:00:11.771Z","dependency_job_id":null,"html_url":"https://github.com/codeat3/icndb","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeat3%2Ficndb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeat3%2Ficndb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeat3%2Ficndb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeat3%2Ficndb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeat3","download_url":"https://codeload.github.com/codeat3/icndb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245320650,"owners_count":20596224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T07:33:14.210Z","updated_at":"2025-03-24T17:46:12.754Z","avatar_url":"https://github.com/codeat3.png","language":"PHP","readme":"# A PHP wrapper for Internet Chuck Norris Database (ICNDb)\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/codeat3/icndb.svg?style=flat-square)](https://packagist.org/packages/codeat3/icndb)\n[![Build Status](https://img.shields.io/travis/codeat3/icndb/master.svg?style=flat-square)](https://travis-ci.org/codeat3/icndb)\n[![Quality Score](https://img.shields.io/scrutinizer/g/codeat3/icndb.svg?style=flat-square)](https://scrutinizer-ci.com/g/codeat3/icndb)\n[![Total Downloads](https://img.shields.io/packagist/dt/codeat3/icndb.svg?style=flat-square)](https://packagist.org/packages/codeat3/icndb)\n\nThis PHP package is a fork of [jcldavid/ICNDb](https://github.com/jcldavid/ICNDb) by Cyrus David.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require codeat3/icndb\n```\n\n## Usage\n\n``` php\n$config = array(\n\t'firstName' =\u003e 'Cyrus',\n\t'lastName' =\u003e 'David'\n);\n\n// Pass an optional parameter to change the firstName and lastName\n// Default is Chuck Norris\n$chuck = new Swapnilsarwe\\ICNDbClient($config);\n\n// Get the total Chuck Norris jokes stored in ICNDb\n$total = $chuck-\u003ecount()-\u003eget();\n\n// Get all categories\n$categories = $chuck-\u003ecategories()-\u003eget();\n\n// Get a specific joke by it's ID\n$specific = $chuck-\u003especific(18)-\u003eget();\n\n//Get a random joke\n$random = $chuck-\u003erandom()-\u003eget();\n\n// Get multiple random jokes\n$random2 = $chuck-\u003erandom(3)-\u003eget();\n\n// use exclude() to get jokes not belong to that category\n$exclude = $chuck-\u003erandom()-\u003eexclude('nerdy')-\u003eget();\n\n// you can also supply an array\n$exclude2 = $chuck-\u003erandom()-\u003eexclude(array('nerdy', 'explicit'))-\u003eget();\n\n// or chain them\n$exclude3 = $chuck-\u003erandom(2)-\u003eexclude('explicit')-\u003eexclude('nerdy')-\u003eget();\n\n// use limitTo() to get jokes only from that category\n// you may supply an array or chain them like exclude()\n$limit = $chuck-\u003erandom()-\u003elimitTo('nerdy')-\u003eget();\n```\n\n## Exceptions\n\n**APIUnavailableException** - API is either unreachable/unavailable\n\n**ChainNotAllowedException** - When these methods are chained together `random()`, `specific($id)`, `categories()`, `count()`\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email swapnilsarwe@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Swapnil Sarwe](https://github.com/codeat3)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## PHP Package Boilerplate\n\nThis package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeat3%2Ficndb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeat3%2Ficndb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeat3%2Ficndb/lists"}