{"id":14987445,"url":"https://github.com/tattersoftware/codeigniter4-reddit","last_synced_at":"2025-07-29T21:35:09.694Z","repository":{"id":39749429,"uuid":"313490601","full_name":"tattersoftware/codeigniter4-reddit","owner":"tattersoftware","description":"Reddit SDK for CodeIgniter 4","archived":false,"fork":false,"pushed_at":"2024-01-17T22:28:31.000Z","size":120,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-07-20T23:26:39.662Z","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/tattersoftware.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-17T02:57:27.000Z","updated_at":"2022-03-11T14:43:18.000Z","dependencies_parsed_at":"2024-09-25T00:32:59.976Z","dependency_job_id":null,"html_url":"https://github.com/tattersoftware/codeigniter4-reddit","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.02777777777777779,"last_synced_commit":"929796657dbf0cf5ca6d456c57d11a83b26cadd2"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tattersoftware/codeigniter4-reddit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-reddit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-reddit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-reddit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-reddit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tattersoftware","download_url":"https://codeload.github.com/tattersoftware/codeigniter4-reddit/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tattersoftware%2Fcodeigniter4-reddit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267763447,"owners_count":24140822,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09-24T14:14:37.594Z","updated_at":"2025-07-29T21:35:09.593Z","avatar_url":"https://github.com/tattersoftware.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codeigniter4-reddit\nReddit SDK for CodeIgniter 4\n\n[![](https://github.com/tattersoftware/codeigniter4-reddit/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-reddit/actions?query=workflow%3A%22PHPUnit)\n[![](https://github.com/tattersoftware/codeigniter4-reddit/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-reddit/actions?query=workflow%3A%22PHPStan)\n\n## Quick Start\n\n1. Install with Composer: `\u003e composer require tatter/reddit`\n2. Supply Reddit credentials in **.env**\n3. Get API results:\n```\nforeach (service('reddit')-\u003efetch('new') as $thing)\n{\n\techo (string) $thing; // \"Comment\" or \"Link\"\n\techo $thing-\u003elink_permalink; // E.g. \"https://www.reddit.com/r/pythonforengineers/comments/jox9zy/great_video_for_the_python_programers\"\n}\n\n```\n\n## Description\n\n**Reddit SDK** provides a framework-ready wrapper to the API endpoints\ndescribe in the [Reddit API documentation](https://www.reddit.com/dev/api).\n\n\n## Configuration (optional)\n\nThe library's default behavior can be altered by extending its config file. Copy\n**examples/Reddit.php** to **app/Config/** and follow the instructions\nin the comments. If no config file is found in **app/Config** then the library will use its own.\n\n## Credentials\n\nThis library requires a valid Reddit application to acquire access tokens that work with\nAPI. For more details read the [Reddit OAuth2 wiki](https://github.com/reddit-archive/reddit/wiki/OAuth2).\n\n1. Login to Reddit and visit the \"authorized applications\" page (https://www.reddit.com/prefs/apps/)\n2. Under \"developed applications\" select \"create an app...\"\n3. Select \"script\" as the application type\n4. Provide a name, description, and URLs in the required text fields\n5. Select \"create app\"\n\nOnce your application is created you will need to copy the \"client ID\" and \"secret\" (see the\nwiki article above for help). Add these along with your username and password into your\nproject's **.env** file, for example:\n```\n#--------------------------------------------------------------------\n# REDDIT API\n#--------------------------------------------------------------------\n\nreddit.clientId = as98-asdn3h93r\nreddit.clientSecret = LKhsa-ASJDn9a8sdion_laskdn0\nreddit.username = MyFiRsTrEdItTbOt\nreddit.password = ReallySecurePassword321\n```\n\n## Usage\n\nThe easiest way to access the client is via the CodeIgniter's Services:\n\n\t$reddit = service('reddit');\n\nThe client will handle authentication (assuming your credentials are valid), rate limiting,\nresponse filtering and formatting. Access client methods in chains to set up the request,\nthen use `fetch()` to kick it off:\n\n\t$comments = $reddit-\u003esubreddit('catgifs')-\u003elimit(10)-\u003efetch('comments');\n\nFor more advanced needs you may use the `request($uri, $data, $query)` method which returns\nthe actual `Response` object, providing access to headers, etc. See also\n**HTTP/RedditRequest.php** and **HTTP/RedditResponse.php** for some of the API handling\ndone \"under the hood\".\n\n## Troubleshooting\n\nShould something go wrong all anticipated exceptions are wrapped in `Tatter\\Reddit\\Exceptions\\RedditException`,\nso you can catch them and figure out what happened:\n```\ntry\n{\n\t$comments = $reddit-\u003esubreddit('php')-\u003efetch('new');\n}\ncatch (\\Tatter\\Reddit\\Exceptions\\RedditException $e)\n{\n\techo $e-\u003egetMessage(); // \"API responded with an error: Invalid authorization\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-reddit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftattersoftware%2Fcodeigniter4-reddit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftattersoftware%2Fcodeigniter4-reddit/lists"}