xkcd

Privateunrated

Content

13 lines
{=(comment):This section determines what the available number of XKCD comics are using a point of origin number and date, and then doing time math to determine how many have been added since, with the understanding that comics are published every Monday/Wednesday/Friday}
{=(PON):2268}
{=(PONDT):2020-02-16 00:00:00}
{=(PONUT):{strf({PONDT}):%s}}
{=(diff):{m:trunc({unix}-{PONUT})}}
{=(avail):{m:trunc({PON}+trunc({diff}/604800)*3+trunc({diff}%604800/86400)/2)}}

{=(comment):This section determine if provided arguments indicate user wants either a random comic or a specific comic. Tests to see if args is either part of the word "random" or is a number and between 1 and {avail}. If an invalid number is provided, an error will be output, otherwise the url and suffix are output. If arguments are null or would not produce a suffix, suffix will be empty, producing a link to the most recent XKCD comic.}
{=(rngchk):{if({args(1)}!=):{in({lower:{args(1)}}):random}}}
{=(numchk):{if({args(1)}=={m:trunc({args(1)}/1)}):{args(1)}}}
{=(suff):{if({rngchk}==true):{range:1-{avail}}|{all({numchk}>0|{numchk}<={avail}|{numchk}!=):{numchk}}}}
{=(error):{if({numchk}!=):{any({numchk}<1|{numchk}>{avail}):That's not a valid XKCD comic number. Valid numbers are 1-{avail}.}}}
{if({error(1)}!=):{error}|https://xkcd.com/{suff}}
Raw JSON
{
  "id": 188328,
  "created_at": "2022-04-26T10:36:11.544Z",
  "tag_name": "xkcd",
  "nsfw": false,
  "owner_id": "382983659768119307",
  "uses": 1,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "577234487981899782",
  "sharer": "382983659768119307",
  "content": "{=(comment):This section determines what the available number of XKCD comics are using a point of origin number and date, and then doing time math to determine how many have been added since, with the understanding that comics are published every Monday/Wednesday/Friday}\n{=(PON):2268}\n{=(PONDT):2020-02-16 00:00:00}\n{=(PONUT):{strf({PONDT}):%s}}\n{=(diff):{m:trunc({unix}-{PONUT})}}\n{=(avail):{m:trunc({PON}+trunc({diff}/604800)*3+trunc({diff}%604800/86400)/2)}}\n\n{=(comment):This section determine if provided arguments indicate user wants either a random comic or a specific comic. Tests to see if args is either part of the word \"random\" or is a number and between 1 and {avail}. If an invalid number is provided, an error will be output, otherwise the url and suffix are output. If arguments are null or would not produce a suffix, suffix will be empty, producing a link to the most recent XKCD comic.}\n{=(rngchk):{if({args(1)}!=):{in({lower:{args(1)}}):random}}}\n{=(numchk):{if({args(1)}=={m:trunc({args(1)}/1)}):{args(1)}}}\n{=(suff):{if({rngchk}==true):{range:1-{avail}}|{all({numchk}>0|{numchk}<={avail}|{numchk}!=):{numchk}}}}\n{=(error):{if({numchk}!=):{any({numchk}<1|{numchk}>{avail}):That's not a valid XKCD comic number. Valid numbers are 1-{avail}.}}}\n{if({error(1)}!=):{error}|https://xkcd.com/{suff}}",
  "embed": "{}",
  "last_fetched": "2026-10-20T21:29:43.104Z"
}