{"id":13405431,"url":"https://github.com/mikecao/shorty","last_synced_at":"2025-04-07T19:15:09.863Z","repository":{"id":40897304,"uuid":"2236966","full_name":"mikecao/shorty","owner":"mikecao","description":"A simple URL shortener for PHP","archived":false,"fork":false,"pushed_at":"2020-10-02T16:08:47.000Z","size":17,"stargazers_count":264,"open_issues_count":9,"forks_count":101,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-07-31T19:45:57.317Z","etag":null,"topics":["php","url-shortener"],"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/mikecao.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":"2011-08-19T23:21:46.000Z","updated_at":"2024-07-16T10:50:58.000Z","dependencies_parsed_at":"2022-08-10T01:18:01.783Z","dependency_job_id":null,"html_url":"https://github.com/mikecao/shorty","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecao%2Fshorty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecao%2Fshorty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecao%2Fshorty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecao%2Fshorty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikecao","download_url":"https://codeload.github.com/mikecao/shorty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"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":["php","url-shortener"],"created_at":"2024-07-30T19:02:01.951Z","updated_at":"2025-04-07T19:15:09.819Z","avatar_url":"https://github.com/mikecao.png","language":"PHP","funding_links":[],"categories":["PHP","类库"],"sub_categories":["URL/Domain"],"readme":"# Shorty\n\nShorty is a simple URL shortener for PHP.\n\n## Installation\n\n1\\. Download and extract the files to your web directory.\n\n2\\. Use the included `database.sql` file to create a table to hold your URLs.\n\n3\\. Configure your webserver.\n\nFor **Apache**, edit your `.htaccess` file with the following:\n\n    RewriteEngine On\n    RewriteCond %{REQUEST_FILENAME} !-f\n    RewriteCond %{REQUEST_FILENAME} !-d\n    RewriteRule ^(.*)$ index.php?q=$1 [QSA,L]\n\nFor **Nginx**, add the following to your server declaration:\n\n    server {\n        location / {\n            rewrite ^/(.*)$ /index.php?q=$1;\n        }\n    }\n\n4\\. Edit the `config.php` file.\n\n## Generating short URLs\n\nTo generate a short URL, simply pass in a `url` query parameter to your Shorty installation:\n\n    http://example.com/?url=http://www.google.com\n\nThis will return a shortened URL such as:\n\n    http://example.com/9xq\n\nWhen a user opens the short URL they will be redirected to the long URL location.\n\nBy default, Shorty will generate an HTML response for all saved URLs.\nYou can alter the response format by passing in a `format` query parameter.\n\n    http://example.com/?url=http://www.google.com\u0026format=text\n\nThe possible formats are `html`, `xml`, `text`, and `json`.\n\n## Whitelist\n\nBy default anyone is allowed to enter a new URL for shortening. To restrict the saving of URLs to \ncertain IP addresses, use the `allow` function:\n\n    $shorty-\u003eallow('192.168.0.10');\n\n## Requirements\n\n* PHP 5.1+\n* PDO extension\n\n## License\n\nShorty is licensed under the [MIT](https://github.com/mikecao/shorty/blob/master/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikecao%2Fshorty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikecao%2Fshorty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikecao%2Fshorty/lists"}