Docs

To add foxes to your project you need to git clone or add as a submodule https://github.com/Foxes-cool/Foxes-C. At the top of your code you can add #include "./Foxes-C/foxes.h" (this could be different depending on where your .h file is). To compile your program you will need to add the ./Foxes-C/foxes.c to your compiling and add -lcurl to the end of your compile arguments. Example: gcc -o my_program main.c ./Foxes-C/foxes.c -lcurl.

To use foxes anywhere in your code you can do foxes_{tag}((foxes_options){}), example would be foxes_fox((foxes_options){}), to see all of the tags scroll down. This will return a URL like https://img.foxes.cool/fox/0.jpg. Do note that if you want to prevent memory leaks you need to free the URL that comes out of this function.

To use the image manipulation you can add some fields in your foxes_options struct, an example is foxes_fox((foxes_options){.width = 150, .height = 150}). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - .width = 150
  • Height - .height = 150
  • Aspect ratio - .aspectRatio = (char*) "1:2"

To add the foxes cli program you need to do run git clone https://github.com/Foxes-cool/Foxes-Cli
cd Foxes-Cli
make
sudo make install

To use foxes in your shell scripts and in the cli you can do foxes {tag}, an example would be foxes fox. This will return a URL like https://img.foxes.cool/fox/0.jpg.

To use the image manipulation you can add some cli fields, example is foxes -w 150 -h 150 fox. This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - -w 150
  • Height - -h 150
  • Aspect ratio - -r "1:2"

To add foxes to your project you need to add {:foxes, "~> 1.0"} to your mix.exs.

To use foxes anywhere in your code you can do Foxes.{tag}(%{}), an example would be Foxes.fox(%{}), to see all of the tags scroll down. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add an item inside your object Foxes.fox(%{width: 150, height: 150}). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - width: 150
  • Height - height: 150
  • Aspect ratio - aspect_ratio: "1:2"

To add foxes to your project you need to do go get github.com/Foxes-cool/Foxes-Go and add import "github.com/Foxes-cool/Foxes-Go" to the top of your file.

To use foxes anywhere in your code you can do img, err := foxes.{tag}(), an example would be img, err := foxes.Fox(), to see all of the tags scroll down. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add a function after your main function call, an example is img, err := foxes.Fox(foxes.Options{Width: 150, Height: 150}). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - Width: 150
  • Height - Height: 150
  • Aspect ratio - AspectRatio: "1:2"

To add Foxes to your project please install the JitPack repository, this should provide you the exact code to add to your configuration files. Inside your code you can import it by doing import cool.foxes.Foxes;.

To use Foxes anywhere in your code you can do Foxes.{tag}(Foxes.Options()), an example would be Foxes.Fox(Foxes.Options()), to see all of the tags scroll down. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add a function after your main function call, an example is Foxes.Fox(Foxes.Options().Width(150).Height(150)). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - .Width(150)
  • Height - .Height(150)
  • Aspect ratio - .AspectRatio("1:2")

To enable the API for the web is pretty simple. You can either download https://github.com/Foxes-cool/Foxes-Web/blob/main/dist/foxes.min.js , or you can enable the API by adding this to your header section
<script src="https://cdn.jsdelivr.net/gh/Foxes-cool/Foxes-Web/dist/foxes.min.js"></script>

Once you have enabled the library you will have access to all of the tags without doing any of the manual work. You can use them by for example doing foxes.fox(), it will return something like https://img.foxes.cool/fox/0.jpg. The syntax is foxes.{tag}(), to find the tags just scroll down and you will see them. Do note that in the JavaScript library all the names start with a lowercase.

You can have do some real time image manipulation by adding an options as the first parameter to the function. An example would be like foxes.fox({width: 150}), this will generate a random image that has a max width of 150px. You can string multiple of them by doing foxes.fox({width: 150, height: 150}), this will get a random image that has a max width of 150px and max height of 150px. Note this will preserve aspect ratio so it is very likely that either width or height will be 150px but not both.

For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - width: 150
  • Height - height: 150
  • Aspect ratio - aspect_ratio: "1:2"

To install the foxes.cool library you just do npm i foxes.cool. Now anywhere in your project you can do const foxes = require("foxes.cool");. To see how to use this look under the Usage section.

To install the foxes.cool library you just do npm i foxes.cool. Now anywhere in your project you can do foxes = require "foxes.cool";. To see how to use this look under the Usage section. Do remember that you are automatically placed in async so you don't need to do the async function boiler plate. You also need to remove all the ;.

To install the foxes.cool library you just add import foxes from "https://deno.land/x/foxes@1.0.1/deno.ts"; to the top of your file or use any other way you want to import that library. To see how to use this look under the Usage section.

To install the foxes.cool library you just do npm i foxes.cool. Now anywhere in your project you can do const foxes = require("foxes.cool");. To see how to use this look under the Usage section.

To install the foxes.cool library you just do npm i foxes.cool. Now anywhere in your project you can do const foxes = require("foxes.cool");. To see how to use this look under the Usage section.

Once you have added your foxes variable you are able to request for all of the images through a simple API. The syntax for requesting an image is await foxes.{tag}(), an example is await foxes.fox(). To see all of the tags you can scroll down. Do note that all of the names start with a lowercase letter. This will return a URL like https://img.foxes.cool/fox/0.jpg.

To use image manipulation, you are going to add an object as the first parameter. This will look like await foxes.fox({width: 150, height: 150}) and this will return something like https://img.foxes.cool/fox/0.jpg?width=150&height=150. To see details about all of the arguments look inside the Image Manipulation section. This is how you set each of the parameters:

  • Width - width: 150
  • Height - height: 150
  • Aspect ratio - aspect_ratio: "1:2"
If you want to see an example in your respective language please look inside the Foxes-Javascript/example folder in GitHub. Do note that the first line might be a little different than what was told of you to do in this document. Please do what this document says over what is in those files.

To add foxes to your project you need to do opam repository add foxes git+https://github.com/Foxes-cool/Opam-repository and then do opam install foxes to install the library. Dont forget to add foxes as your dependency to your project.

To use foxes anywhere in your code you can do Foxes.{tag} [], an example would be Foxes.fox [], to see all of the tags scroll down. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add a function after your main function call, an example is Foxes.fox [ Foxes.width 150; Foxes.height 150 ]. This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - Foxes.width 150
  • Height - Foxes.height 150
  • Aspect ratio - Foxes.aspect_ratio "1:2"

To add foxes to your project you need to do download the file at https://github.com/Foxes-cool/Foxes-PHP/raw/main/foxes.php and then do add require "foxes.php" to add the library to your project.

To use foxes anywhere in your code you can do foxes_{tag}([]), an example would be foxes_fox([]), to see all of the tags scroll down. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add an item inside your object foxes_fox(["width" => 150, "height" => 150]). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - "width" => 150
  • Height - "height" => 150
  • Aspect ratio - "aspect_ratio" => "1:2"

To add foxes_cool to your project you just need to do pip install foxes_cool, don't forget to add this to your requirements.txt if you have one.

To use foxes_cool, add from foxes_cool import foxes to your files. Once you have done this to get an image you can do foxes.{tag}(), an example would be foxes.fox(), to see all of the tags scroll down, do note that the names all start with a lowercase letter. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add an object inside the (), an example is foxes.fox({"width": 150, "height": 150}). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - "width": 150
  • Height - "height": 150
  • Aspect ratio - "aspect_ratio": "1:2"

To add foxes to your project you just need to do gem install foxes. Then in your files you will need to do require "foxes".

To use foxes anywhere in your code you can do Foxes.{tag}({}), an example would be Foxes.fox({}), to see all of the tags scroll down, do note that the names all start with a lowercase letter. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add a function after your main function call, an example is Foxes.fox({"width" => 150, "height" => 150}). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - "width" => 150
  • Height - "height" => 150
  • Aspect ratio - "aspect_ratio" => "1:2"

To add foxes to your project you just need to do cargo add foxes.

To use foxes anywhere in your code you can do foxes::{tag}()?, an example would be foxes::fox()?, to see all of the tags scroll down, do note that the names all start with a lowercase letter. This will return a URL like https://img.foxes.cool/fox/0.jpg

To use the image manipulation you can add a function after your main function call, an example is foxes::fox()?.width(150).height(150). This will return a link like https://img.foxes.cool/fox/0.jpg?width=150&height=150 For details about what each of the following do is in the Image Manipulation section, here is how each of the following would be set:

  • Width - .width(150)
  • Height - .height(150)
  • Aspect ratio - .aspect_ratio(1,2)

Foxes.cool, works a little differently than what you are probably used to. You are probably used to having a rest API where you make a request to an endpoint and it returns a URL. This is both inefficient, but also demanding on the servers. If you want to access a random image, you are going to have to generate the image id yourself. This is not as complicated as it seams though!

You are first going to want to know how many images there are for a certain tag. This can be achieved by making a request to https://foxes.cool/counts/{}, replacing {}, with your tag. For instance https://foxes.cool/counts/fox returns 953. This number you can cache for any amount of time you want. I would cache this number until midnight UTC. There are also times where images are going to be removed because someone has made a valid removal. If this happens we will try and find a backup image to replace the id, so the images you know will always be the same id. If we are going to loose an image and don't find a backup we are going to update the count as soon as we can, but we will remove our image ~5 minuets after UTC midnight to give you time to update to the new count.

Now we have the fun part, actually generating the image URLs. The simplest way to get an id is by doing this calculation floor(Random*count) or floor(Random(0, count)). For the first example this is assuming Random is a random float between 0 and 1. For the second example the Random function is assumed to be an exclusive random, meaning count wont ever be a possibility. Once you have gotten the random id, to get the image URL is pretty simple, you just do https://img.foxes.cool/{tag}/{id}.jpg. In this example {} is made to signify a variable. Do note that your id needs to be calculated the way above and you wont necessarily be able to transfer this id to another tag. You will need to probably generate a new id for a different tag.

There is support for real time image manipulation. These can be controlled by URL parameters like width and height. An example URL would be https://img.foxes.cool/fox/0.jpg?width=150&height=150 , this would set the max width and height to be 150px. For details about all of the things you can do please look in the Image Manipulation section. This is how you use each of them though:

  • Width - width=150
  • Height - height=150
  • Aspect ratio - aspect_ratio=1:2

To use Foxes is your browser you can install it in these ways:

Now that you have it installed to use it you have a few key binds.

  • ctrl + shift + f > ctrl + shift + f: gives you a random fox image.
  • ctrl + shift + f > ctrl + shift + 1: gives you a random curious image.
  • ctrl + shift + f > ctrl + shift + 2: gives you a random happy image.
  • ctrl + shift + f > ctrl + shift + 3: gives you a random scary image.
  • ctrl + shift + f > ctrl + shift + 4: gives you a random sleeping image.
This might sound like a hard key bind to use, but you don't actually have to press the second pair of ctrl + shift if you keep them held down from the first time. That means if you hold down ctrl + shift then press f 2 times, you will get your image.

  • Width - This is the max width for the image. This is always going to be a number with the size in pixels.
  • Height - This is the exact same as width but for height.
  • Aspect ratio - This will set the aspect ratio. The value that is expected is a string in the format of "{width}:{height}". Do note that this does not stretch the image and will crop the image to make it fit the desired aspect ratio.

Tags

Fox

953 images

Curious

40 images

Happy

25 images

Scary

34 images

Sleeping

48 images