{"id":22725081,"url":"https://github.com/katmore/shrturl","last_synced_at":"2025-03-29T23:22:33.691Z","repository":{"id":4350376,"uuid":"5486432","full_name":"katmore/shrturl","owner":"katmore","description":"a URL shortener webservice","archived":false,"fork":false,"pushed_at":"2017-03-21T07:24:54.000Z","size":1618,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T00:44:17.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/katmore.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":"2012-08-20T20:30:40.000Z","updated_at":"2017-03-03T00:32:24.000Z","dependencies_parsed_at":"2022-09-03T05:50:42.529Z","dependency_job_id":null,"html_url":"https://github.com/katmore/shrturl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fshrturl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fshrturl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fshrturl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/katmore%2Fshrturl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/katmore","download_url":"https://codeload.github.com/katmore/shrturl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246256094,"owners_count":20748190,"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-10T15:08:48.057Z","updated_at":"2025-03-29T23:22:33.668Z","avatar_url":"https://github.com/katmore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shrturl #\n*a URL shortener webservice*\n\nShrturl is a RESTful web service that behaves similar to enterprise level URL shortening services (such as bit.ly).\n\n* Latest Version:\n   * http://github.com/katmore/shrturl\n\n* Documentation\n   * http://github.com/katmore/shrturl/wiki\n\n## Terminology ##\n * **code** or **short code**: the unique portion (token) contained in a short URL\nthat serves as reference to full URL. The typically jibberish looking sequence of alpha numeric\ncharacters used in most URL shorteners.\n * **short url**: the full URL that includes the short code (ie: http://example.com/shrt.php?code=abc)\n * **target url**: the full URL that needs to be changed into a short URL\n\n## Installation ##\n   1. extract/copy the **shrturl project** somewhere\n   ```bash\n   git clone https://github.com/katmore/shrturl.git\n   cd shrturl\n   ```\n   \n   2. create autoloader and resolve dependencies using Composer...\n   ```bash\n   composer update\n   ```\n   \n   3. run the db-install.php script...\n   ```bash\n   php bin/db-install.php\n   ```\n   \n   4. copy *app/config/shrturl/mysql-sample.ini* to **mysql.ini** and edit...\n   ```bash\n   cp app/config/shrturl/mysql-sample.ini app/config/shrturl/mysql.ini\n   vi app/config/shrturl/mysql.ini\n   ```\n   \n   5. populate the database with initial set of randomly generated short codes...\n   ```bash\n   php bin/make-codes.php 1000\n   ```\n   \n## Webservice Usage ##\n* Redirect to target URL:\n\n   `https://example.com/shrt.php?code=abc`\n\n\t(where 'abc' is the code returned by \"Shorten URL\" request)\n\t\n* Display short URL, Create if it does not exist\n\t* POST REQUEST METHOD\n      \t`https://example.com/shrt.php?target=http://my_really_long_uri`\n      * adding a query var named 'POST' to the query string to will also invoke 'POST' (if using GET REQUEST METHOD)\n         \u003e https://example.com/shrt.php?POST\u0026target=http://my_really_long_uri\n   \t* add a query var and value for 'url_base' if you want to display a short url with a base\n   \t\t\u003e URL other than what is configured in the 'default' section of shrt-config.\n         \u003e A value for 'url_base' should correspond with a config var in shrt-config.php\n   \t\t\n   * POST REQUEST METHOD\n      \u003e https://example.com/shrt.php?target=http://my_really_long_uri\u0026url_base=reallyshort\n\t\t* would display/create: http://rlysh.rt/abc\n      * see example in shrt-config-example.php\n         \u003e [https://github.com/katmore/shrturl/blob/master/shrt-config-example.php]\n\t\n* Change Target URL\n\t* POST REQUEST METHOD\n      \t\u003e https://example.com/shrt.php?changeTarget=http://a_different_really_long_uri\u0026code=abc\n\t* adding a query var named 'POST' to the query string to will also invoke 'POST' (if using GET REQUEST METHOD)\n\n* Shorten Multiple URLs\n\t* POST REQUEST METHOD\n   \u003e https://example.com/shrt.php?request={JSON_document}\n\t* where 'target' is a valid JSON document with the following structure:\n\n   ``` json\n\t{\"shrt\":{\"target\":[\"http://target_url_1\",\"http://target_url_2\",\"http://etc\"]}}\n   ```\n   \n\t* adding a query var named 'POST' to the query string to will also invoke 'POST' (if using GET REQUEST METHOD)\n\t\t\n\n## Webservice Deployment Suggestions ###\n* use 2 different FQDNs (fully qualified domain names) for this service\n   * FQDN #1 for 'end use' the short code, such as: \n   \u003e http://rlysh.rt\n\n   * FQDN #2 for API calls to short code service, such as:\n   \u003e https://shrturl.example.com\n\n* for example:\n   1. on the 'end use FQDN' (#1)\n      1. install/configure project as described in installation section of this document\n      2. configure a url_base in addition to the 'default'\n      \u003e see url_base section in shrt-config-example.php\n\t* contains example of .htaccess or equivelent configuration for web server\n\t* http://rlysh.rt/abc will work now\n\t* where 'abc' is the short code provided by previous call to short API\n\t\t\t\t\n   1. on the 'API FQDN' (#2) use as described in usage section\n   \u003e in API requests to obtain a short code ensure that:\n   \u003e provide a url_base parameter in query that corresponds to the 'end use' \n   \u003e that is set in your shrt-config-example.php\n\t\t\t\t\n## Legal ##\n### Copyright\nFlat webapp - https://github.com/katmore/flat-webapp\n\nCopyright (c) 2012-2017 Doug Bird. All Rights Reserved.\n\n\n### License\n\"shrturl\" is copyrighted free software.\n\nYou can redistribute it and/or modify it under either the terms and conditions of the\n\"[The MIT License (MIT)](https://github.com/katmore/shrturl/blob/master/LICENSE)\"; or the terms and conditions of the \"[GPL v3 License](https://github.com/katmore/shrturl/blob/master/GPLv3)\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatmore%2Fshrturl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatmore%2Fshrturl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatmore%2Fshrturl/lists"}