{"id":20125922,"url":"https://github.com/robole/xkcd","last_synced_at":"2025-05-06T17:34:56.292Z","repository":{"id":153341324,"uuid":"628976980","full_name":"robole/xkcd","owner":"robole","description":"Read XKCD from the comfort of your terminal","archived":false,"fork":false,"pushed_at":"2024-02-05T23:23:17.000Z","size":96,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-06T23:48:31.965Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"funding.yml","license":"LICENSE.md","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},"funding":{"ko_fi":"roboleary"}},"created_at":"2023-04-17T11:21:34.000Z","updated_at":"2024-02-06T23:48:31.966Z","dependencies_parsed_at":"2024-02-05T23:52:48.489Z","dependency_job_id":null,"html_url":"https://github.com/robole/xkcd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robole%2Fxkcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robole%2Fxkcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robole%2Fxkcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robole%2Fxkcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robole","download_url":"https://codeload.github.com/robole/xkcd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224517379,"owners_count":17324407,"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-11-13T20:11:48.206Z","updated_at":"2024-11-13T20:11:48.948Z","avatar_url":"https://github.com/robole.png","language":"Shell","funding_links":["https://ko-fi.com/roboleary"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n    \u003cimg align=\"center\" src=\"img/logo.png\" width=\"150\" height=\"150\" alt=\"xkcd logo\"\u003e\n  \u003cbr\u003e\n\txkcd\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003eRead xkcd from the comfort of your terminal\u003c/strong\u003e\u003c/p\u003e\n\u003cbr\u003e\n\n[xkcd](https://xkcd.com/) is probably the most popular webcomic with devs. It only seems right that you can read it from the comfort of your terminal via a `xkcd` command.\n\n \u003cp align=\"center\"\u003e\u003cimg src=\"img/xkcd-with-title.png\" width=\"610\" height=\"496\" alt=\"xkcd command on terminal\"\u003e\u003c/p\u003e\n\n## Requirements\n\nHere is a summary of the dependencies:\n- [Kitty](https://sw.kovidgoyal.net/kitty/) terminal. Kitty shows images via the `icat` kitten which is included in the default installation.\n- [ImageMagick](https://www.imagemagick.org/) is used by Kitty under hood as far as I know.\n- The utilties you find in most unix-like systems: [`curl`](https://curl.se/docs/manpage.html), [`grep`](https://en.wikipedia.org/wiki/Grep), [`cut`](https://en.wikipedia.org/wiki/Cut_(Unix)), and `perl`.\n\nIf you do not want to use Kitty, I believe [iTerm2](https://iterm2.com/index.html) has similar functionality with its [`imgcat` script](https://iterm2.com/documentation-images.html). It is a minor change to adapt the script to use that instead.\n\n## Install\n\nIt is a shell script. You can run it as `./xkcd` when the file is in the current working directory.\n\nIt is preferable to move it to an executable location and be able to run it using `xkcd` anywhere e.g. move the *xkcd* file to */usr/local/bin* on linux.\n\n## Usage\n\n```\nUsage: xkcd [-l|--latest] [-r|--random] [-h|--help]\n  -h, --help          \tPrint the help page.\n  -l, --latest        \tShow the latest comic.                                   \n  -r, --random        \tShow a random comic.                                  \n```\n\nFor example, to show a random comic, run the command `xkcd --random`.\n\n## Versions\n\nI wrote 2 versions of this with the same interface:\n1. **This is the version that scrapes the webpages (*main* branch)**.\n1. The alternative version uses the web api, go to the *json* branch to check that out.\n\nI discuss the code in this article -- [Read XKCD in the terminal with some bash magic](https://www.roboleary.net/2022/02/24/xkcd-in-the-terminal-with-some-bash-magic.html).\n\n## Appreciate\n\nYou can show your appreciation by:\n1. [Buying me a coffee or sponsoring me](https://ko-fi.com/roboleary). This will **offer me encouragement** to continue, and can provide **a path to dedicating more time to open-source** in the future.\n1. Starring the repo 🌟. This will **help other people find this**.\n\nThank you! 🙏\n\n## Attribution\n\nXKCD is licensed under a [Creative Commons Attribution-NonCommercial 2.5 License](https://creativecommons.org/licenses/by-nc/2.5/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobole%2Fxkcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobole%2Fxkcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobole%2Fxkcd/lists"}