{"id":19526098,"url":"https://github.com/ericoc/indego-php-lib","last_synced_at":"2025-02-26T01:44:38.925Z","repository":{"id":147419610,"uuid":"46314837","full_name":"ericoc/indego-php-lib","owner":"ericoc","description":"PHP library for working with the Philadelphia Indego Bike Share API","archived":false,"fork":false,"pushed_at":"2019-04-15T14:58:53.000Z","size":102,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T15:29:17.069Z","etag":null,"topics":["api","api-client","bicycle","bike","bike-share","bike-share-station","client","indego","indego-api","philadelphia","philadelphias-bike-share","philly","php","php-library"],"latest_commit_sha":null,"homepage":"https://indego.ericoc.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-17T01:25:21.000Z","updated_at":"2019-04-15T14:58:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2d80cbe-b6b8-40e9-b567-159b2414e70d","html_url":"https://github.com/ericoc/indego-php-lib","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.032258064516129004","last_synced_commit":"3f4113dd320fc8be45b9e311df6102b2584bcda2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Findego-php-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Findego-php-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Findego-php-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericoc%2Findego-php-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericoc","download_url":"https://codeload.github.com/ericoc/indego-php-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240777568,"owners_count":19855857,"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":["api","api-client","bicycle","bike","bike-share","bike-share-station","client","indego","indego-api","philadelphia","philadelphias-bike-share","philly","php","php-library"],"created_at":"2024-11-11T01:08:15.057Z","updated_at":"2025-02-26T01:44:38.899Z","avatar_url":"https://github.com/ericoc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Indego Bike Share PHP Library\n==============================\n\nAbout\n-----\n\nI am mostly fooling around with PHP to get more used to object-orientation as opposed to doing just procedural PHP all of the time. In my journey, I've made a re-usable PHP library for the Philadelphia Indego Bike Share API!\n\nCheck out [the City of Philadelphia GitHub](https://github.com/CityOfPhiladelphia) if you think this library is interesting!\n\n\nExample\n-------\n\n### Code\n\nWhen combined with the provided `Indego` class, the following code will generate the example output in the next section:\n\n\t// Require the Indego class\n\trequire_once('Indego.class.php');\n\n\t// Instantiate the Indego class which will immediately discover all of the stations\n\t$indego = new Indego;\n\n\t// Just get \"university\" stations\n\t$uni_stations = $indego-\u003egetStations('university');\n\n\tprint_r($uni_stations);\n\n\nProviding a argument/filter to `getStations()` to return a list of stations only limits the results within the `Indego` class.\n\nUnfortunately, there does not appear to be a signifcant amount of documentation for the API being used nor does there seem to be any parameters available to limit the stations being retrieved from the API.\n\nCalling `getStations()` without any arguments will return a list of all (*currently*, 103) stations!\n\n### Output\n\n    $ php example.php\n    Array\n    (\n        [3008] =\u003e stdClass Object\n            (\n                [addressStreet] =\u003e 1076 Berks Street\n                [addressCity] =\u003e Philadelphia\n                [addressState] =\u003e PA\n                [addressZipCode] =\u003e 19122\n                [bikesAvailable] =\u003e 9\n                [closeTime] =\u003e 23:58:00\n                [docksAvailable] =\u003e 8\n                [eventEnd] =\u003e\n                [eventStart] =\u003e\n                [isEventBased] =\u003e\n                [isVirtual] =\u003e\n                [kioskId] =\u003e 3008\n                [kioskPublicStatus] =\u003e Active\n                [name] =\u003e Temple University Station\n                [openTime] =\u003e 00:02:00\n                [publicText] =\u003e\n                [timeZone] =\u003e Eastern Standard Time\n                [totalDocks] =\u003e 19\n                [trikesAvailable] =\u003e 0\n                [coordinates] =\u003e Array\n                    (\n                        [0] =\u003e -75.14973\n                        [1] =\u003e 39.98082\n                    )\n\n            )\n\n        [3020] =\u003e stdClass Object\n            (\n                [addressStreet] =\u003e 3051 South St.\n                [addressCity] =\u003e Philadelphia\n                [addressState] =\u003e PA\n                [addressZipCode] =\u003e 19147\n                [bikesAvailable] =\u003e 18\n                [closeTime] =\u003e 23:58:00\n                [docksAvailable] =\u003e 17\n                [eventEnd] =\u003e\n                [eventStart] =\u003e\n                [isEventBased] =\u003e\n                [isVirtual] =\u003e\n                [kioskId] =\u003e 3020\n                [kioskPublicStatus] =\u003e Active\n                [name] =\u003e University City Station\n                [openTime] =\u003e 00:02:00\n                [publicText] =\u003e\n                [timeZone] =\u003e Eastern Standard Time\n                [totalDocks] =\u003e 35\n                [trikesAvailable] =\u003e 0\n                [coordinates] =\u003e Array\n                    (\n                        [0] =\u003e -75.18986\n                        [1] =\u003e 39.94887\n                    )\n\n            )\n\n    )\n\n\nCommand-line script\n--------------------\n\nThe included [`indego-cli.php` script](https://github.com/ericoc/indego-php-lib/blob/master/indego-cli.php) is a fun command-line PHP script that I wrote which uses the `Indego` class/library to get the bike share data from the citys API!\n\n![Indego PHP Library CLI screenshot](https://raw.githubusercontent.com/ericoc/indego-php-lib/master/cli.png \"Indego PHP Library CLI screenshot\")\n\n\nMore Information\n----------------\n* [The actual API, a GeoJSON file](https://www.rideindego.com/stations/json/)\n* [OpenDataPhilly description of the API](https://www.opendataphilly.org/dataset/bike-share-stations)\n* [Interesting article visualizing Indego usage](http://www.randalolson.com/2015/09/05/visualizing-indego-bike-share-usage-patterns-in-philadelphia-part-2/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoc%2Findego-php-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericoc%2Findego-php-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericoc%2Findego-php-lib/lists"}