{"id":21538202,"url":"https://github.com/minicli/curly","last_synced_at":"2025-06-22T01:39:01.549Z","repository":{"id":43176160,"uuid":"242291960","full_name":"minicli/curly","owner":"minicli","description":"Simple Curl Client","archived":false,"fork":false,"pushed_at":"2025-05-01T01:56:13.000Z","size":68,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T02:42:07.869Z","etag":null,"topics":["crawler","curl","hacktoberfest","php"],"latest_commit_sha":null,"homepage":"https://docs.minicli.dev","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/minicli.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-02-22T06:29:21.000Z","updated_at":"2025-05-01T01:56:16.000Z","dependencies_parsed_at":"2023-12-01T02:31:11.290Z","dependency_job_id":"7e71884d-6b8e-4188-9b5e-e44a785fae5d","html_url":"https://github.com/minicli/curly","commit_stats":{"total_commits":32,"total_committers":6,"mean_commits":5.333333333333333,"dds":0.6875,"last_synced_commit":"89ddea30837e038f6eaedbe5d9aabf716fb942fd"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minicli%2Fcurly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minicli%2Fcurly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minicli%2Fcurly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minicli%2Fcurly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minicli","download_url":"https://codeload.github.com/minicli/curly/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253758182,"owners_count":21959545,"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":["crawler","curl","hacktoberfest","php"],"created_at":"2024-11-24T04:11:05.912Z","updated_at":"2025-05-12T14:47:57.115Z","avatar_url":"https://github.com/minicli.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# curly\nA tiny experimental curl client built for Minicli (but can be also used standalone). \n\n## Requirements\n\nRequires `curl` and `php-curl`.\n\n## Installation\n\nTo include Curly in your app, first require the dependency with Composer:\n\n```shell\ncomposer require minicli/curly\n```\n\n## Usage\n\nUse the `Minicli/Curl/Client` class to make GET and POST requests using the `get()` and `post()` methods, respectively.\n\nThis example queries the DEV API and gets the latest posts from a user:\n\n```php\n$crawler = new Client();\n\n$articles_response = $crawler-\u003eget('https://dev.to/api/articles?username=erikaheidi');\n\nif ($articles_response['code'] !== 200) {\n    $app-\u003egetPrinter-\u003eerror('Error while contacting the dev.to API.');\n    return 1;\n}\n\n$articles = json_decode($articles_response['body'], true);\nprint_r($articles);\n```\n\nThe following single-command Minicli application will fetch a user's latest stats from DEV.to using Curly (this requires `minicli/minicli`):\n\n```php\n#!/usr/bin/env php\n\u003c?php\nif (php_sapi_name() !== 'cli') {\n    exit;\n}\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Minicli\\App;\nuse Minicli\\Exception\\CommandNotFoundException;\nuse Minicli\\Curly\\Client;\n\n$app = new App([\n    'debug' =\u003e true,\n    'theme' =\u003e '\\Unicorn'\n]);\n\n$app-\u003eregisterCommand('devto', function () use ($app) {\n    $app-\u003egetPrinter()-\u003edisplay('Fetching from DEV...');\n    $crawler = new Client();\n\n    $articles_response = $crawler-\u003eget('https://dev.to/api/articles?username=DEVUSERNAME');\n\n    if ($articles_response['code'] !== 200) {\n        $app-\u003egetPrinter-\u003eerror('Error while contacting the dev.to API.');\n        return 1;\n    }\n\n    $articles = json_decode($articles_response['body'], true);\n    $table[] = ['Title', 'Reactions'];\n    foreach($articles as $article) {\n        $table[] = [$article['title'], $article['positive_reactions_count']];\n    }\n    $app-\u003egetPrinter()-\u003eprintTable($table);\n    return 0;\n});\n\ntry {\n    $app-\u003erunCommand($argv);\n} catch (CommandNotFoundException $notFoundException) {\n    $app-\u003egetPrinter()-\u003eerror(\"Command Not Found.\");\n    return 1;\n}\n\nreturn 0;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminicli%2Fcurly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminicli%2Fcurly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminicli%2Fcurly/lists"}