Skip to content

erindatkinson/pixawttr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixawttr

example image of a train in a snowy landscape with a composite addition of current conditions in Golden, CO, USA at a random time

Pixawttr is a golang program to automate the creation of a pretty composite forcast image.

It uses the wttr.in service to get "Current conditions" data and an analogous PNG.

It uses the Pixabay Search API to enable the random downloading of an image based on a query string.

Installation

go get github.com/erindatkinson/pixawttr

Prerequisites

Pixawttr has an external dependency of imagemagick.

MacOS/Linux(linuxbrew)

brew bundle

Windows

  1. Follow the instructions
  2. Make sure that the tools are accessible and set in the PATH
  3. If composite --help doesn't work in Powershell and the PATH is set correctly, you will also need to Set-Alias for magick composite to composite.

Usage

To use pixawttr, you'll need to sign up for a Pixabay account, once you've logged in, you can see your API key in the key parameter under the Search Images section of the API docs. (I haven't been able to find a way besides this to get the key :woman-shrugging:)

Once you have the key, you can place it in the environment variable PixabayAPIKey or at $HOME/.pixawttr in the following format

PixabayAPIKey: 12345678-f4f79534645cd471ea614adf92efffbc

after which, you can run

pixawttr
pixawttr -q "search term for bg image"
pixawttr -u f
pixawttr -o alternate_output.png

and the resulting image will be either what you've entered for the outFile path, or outFile.png in the directory you run it.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

All contributors are held to the Code of Conduct adapted from the Contributor Covenant version 1.4

License

By using this you agree to abide by the Pixabay License in the usage of images downloaded from Pixabay.

The code for pixawttr is licensed under MPL V2.0 License

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages