{"id":15028907,"url":"https://github.com/danielsitek/php-random-avatar","last_synced_at":"2026-01-29T23:03:46.926Z","repository":{"id":56961997,"uuid":"97602087","full_name":"danielsitek/php-random-avatar","owner":"danielsitek","description":"A simple service which delivers a random avatar image as the response for GET request. It's a small personal project, built just for fun, learning and experimenting with PHP.","archived":false,"fork":false,"pushed_at":"2017-07-19T20:16:55.000Z","size":421,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T21:48:37.172Z","etag":null,"topics":["composer","php5","project","restful"],"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/danielsitek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-18T13:34:04.000Z","updated_at":"2017-07-19T19:40:14.000Z","dependencies_parsed_at":"2022-08-21T09:20:55.378Z","dependency_job_id":null,"html_url":"https://github.com/danielsitek/php-random-avatar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsitek%2Fphp-random-avatar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsitek%2Fphp-random-avatar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsitek%2Fphp-random-avatar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielsitek%2Fphp-random-avatar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielsitek","download_url":"https://codeload.github.com/danielsitek/php-random-avatar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338447,"owners_count":20275513,"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":["composer","php5","project","restful"],"created_at":"2024-09-24T20:09:19.905Z","updated_at":"2026-01-29T23:03:41.901Z","avatar_url":"https://github.com/danielsitek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Dependencies](https://www.versioneye.com/user/projects/596e2f93368b080061c2c2be/badge.svg?style=flat-round)](https://www.versioneye.com/user/projects/596e2f93368b080061c2c2be?child=summary)\n[![Build Status](https://travis-ci.org/danielsitek/php-random-avatar.svg?branch=master)](https://travis-ci.org/danielsitek/php-random-avatar) \n[![Code Climate](https://codeclimate.com/github/danielsitek/php-random-avatar/badges/gpa.svg)](https://codeclimate.com/github/danielsitek/php-random-avatar)\n![Codacy Badge](https://api.codacy.com/project/badge/Grade/29d4addcd53340249c18c4d083f1e41f)\n\n# README\n\n## Introduction\n\nPhp-Random-Avatar is a simple service which delivers a random image as the response for GET request. It's a small personal project, built just for fun, learning and experimenting with PHP.\n\n## Usage\n\n### Example\n\nFile: `app.php`\n\n```php\n$avatar = new App\\Avatar();\n$router = new App\\Router($avatar);\n\n$avatar-\u003eset_image_root( __DIR__ . '/images' );\n$avatar-\u003eset_images_array( array(\n    'man' =\u003e array(\n        '/man/001.png',\n        '/man/002.png',\n        '/man/003.png',\n        '/man/004.png',\n        '/man/005.png'\n    ),\n    'woman' =\u003e array(\n        '/woman/001.png',\n        '/woman/002.png',\n        '/woman/003.png',\n        '/woman/004.png',\n        '/woman/005.png'\n    )\n) );\n\nif ( in_array( @$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'] ) ) {\n    $router-\u003erun();\n} else {\n    $router-\u003euse_https()-\u003erun();\n}\n```\n\nClone this repository to your server/localhost and open it in your browser.\n\nIn browser, you can request avatar image like this:\n\n`/` for random image from any category.\n\n`/man` for random image from the \"man\" category.\n\n`/woman` for random image from the \"woman\" category.\n\n## License\nFor more information, see [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT) or the accompanying MIT file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielsitek%2Fphp-random-avatar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielsitek%2Fphp-random-avatar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielsitek%2Fphp-random-avatar/lists"}