source: main/branches/master/showmoonphases.go@ 6bbceb9

Last change on this file since 6bbceb9 was 6bbceb9, checked in by www <www@…>, 8 weeks ago

Mirrored from yuuka.git

git-svn-id: https://svn.chaotic.ninja/svn/yuuka-yakumo.izuru@1 0f3ee07c-c614-0a4d-b2a1-86c95f6ad348

  • Property mode set to 100644
File size: 464 bytes
RevLine 
[6bbceb9]1package main
2
3import (
4 "fmt"
5 "io"
6 "net/http"
7)
8
9// Print the current phase of the Moon in standard output
10// Optional arguments: format
11func ShowMoonPhases(format string, lang string) {
12 query := "https://wttr.in/" + "moon" + "?" + format + "&lang=" + lang
13 resp, err := http.Get(query)
14 sanityCheck(err)
15 defer resp.Body.Close()
16 body, err := io.ReadAll(resp.Body)
17 sanityCheck(err)
18 fmt.Printf("%s\n", body)
19}
Note: See TracBrowser for help on using the repository browser.