{"id":17508002,"url":"https://github.com/masdzub/bash-yourls","last_synced_at":"2025-03-05T13:31:43.214Z","repository":{"id":258710908,"uuid":"871520676","full_name":"masdzub/bash-yourls","owner":"masdzub","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-13T21:39:18.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T02:50:22.279Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masdzub.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}},"created_at":"2024-10-12T07:32:41.000Z","updated_at":"2024-11-06T10:10:57.000Z","dependencies_parsed_at":"2024-10-20T08:39:49.513Z","dependency_job_id":"32e4c0a2-b538-4f0a-8fe6-27e87a55cf05","html_url":"https://github.com/masdzub/bash-yourls","commit_stats":null,"previous_names":["masdzub/bash-yourls"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masdzub%2Fbash-yourls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masdzub%2Fbash-yourls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masdzub%2Fbash-yourls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masdzub%2Fbash-yourls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masdzub","download_url":"https://codeload.github.com/masdzub/bash-yourls/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242035051,"owners_count":20061247,"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-10-20T04:01:12.655Z","updated_at":"2025-03-05T13:31:43.201Z","avatar_url":"https://github.com/masdzub.png","language":"Shell","funding_links":[],"categories":["Integrations"],"sub_categories":["3rd party Integrations and Frameworks"],"readme":"# YOURLS URL Shortener Script\n\nA simple Bash script to shorten URLs using the [YOURLS](https://yourls.org/) API. This script allows you to easily generate short links directly from your command line.\n\nInspirated from https://github.com/ozh/yourls-bash\n\n![Command Usage](https://ucarecdn.com/1eb74771-3518-40f6-8a20-47c9dd796f03/-/preview/707x317/)\n\n## Features\n\n- Shortens URLs using a configurable YOURLS instance.\n- Supports custom keywords and titles.\n- Outputs results in multiple formats (JSON, XML, Simple).\n- Configuration is stored in an external file for easy access.\n\n## Requirements\n\n- `curl` command-line tool installed on your system.\n- Access to a YOURLS instance with an API key.\n\n## Installation\n\n1. Clone this repository or download the script.\n2. Make the script executable:\n   ```bash\n   chmod +x yourls\n   ```\n\n## Configuration\n\nBefore using the script, you need to set up the YOURLS configuration.\n\n### Create Configuration File\n\nThe script checks for the configuration file at `~/.config/shortlink.conf`. If it doesn't exist, the script will prompt you to create one.\n\nTo create the configuration file:\n\n1. Run the script:\n   ```bash\n   ./yourls\n   ```\n\n2. When prompted, enter the YOURLS host URL (e.g., `https://sho.rt/`) and your YOURLS API key.\n\n### Example Configuration File (`~/.config/shortlink.conf`)\n\n```bash\nYOURLS_HOST=\"https://sho.rt/\"\nYOURLS_KEY=\"eb9444558f\"\n```\n\n## Usage\n\nYou can use the script to shorten URLs in the following ways:\n\n### Shorten a URL\n\n```bash\n./yourls \u003cURL\u003e\n```\n\n### Options\n\n- `-k`, `--keyword \u003cKEYWORD\u003e`: Specify a custom keyword for the shortened URL.\n- `-t`, `--title \u003cTITLE\u003e`: Specify a custom title for the URL.\n- `-f`, `--format \u003cFORMAT\u003e`: Specify the output format (json, xml, simple; default: simple).\n- `-h`, `--help`: Show the help message.\n\n### Examples\n\n#### Shorten a URL without options\n\n```bash\n./yourls https://example.com\n```\n\n#### Shorten a URL with a custom keyword and title\n\n```bash\n./yourls https://example.com -k mykeyword -t \"My Example\"\n```\n\n#### Shorten a URL with JSON output format\n\n```bash\n./yourls https://example.com -f json\n```\n\n## Output\n\nThe script will display both the original URL and the shortened URL. In case of any errors, appropriate messages will be shown.\n\n### Sample Output\n\n```\nOriginal URL: https://example.com\nShortened URL: https://sho.rt/abc123\n```\n\n## Contributing\n\nFeel free to submit pull requests or issues to improve this script!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasdzub%2Fbash-yourls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasdzub%2Fbash-yourls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasdzub%2Fbash-yourls/lists"}