xkcd-go

Golang tool to read latest, random, or a specific xkcd comic (and download it too).
git clone http://git.hanabi.in/repos/xkcd-go.git
Log | Files | Refs | README | LICENSE

fetch-random-xkcd.go (200B)


      1 package xkcd
      2 
      3 // return the message about a random xkcd.
      4 func FetchRandomXKCD() (msg string) {
      5 	max := getNumOfLatestComic()
      6 	rnd_idx := getRndXKCDIdx(max)
      7 	msg = FetchThisXKCD(rnd_idx)
      8 	return msg
      9 }