Commits

Cédric Bonhomme  committed bef6a40

Added HTML tags.

  • Participants
  • Parent commits b66395b

Comments (0)

Files changed (1)

     quote := rand.Intn(nb_quotes)
 
     // Now use the Quote structure
+    printHTML(quotes.Quotes[quote])
+
+}
+
+func printHTML(quote Quote) {
     os.Stdout.WriteString("Content-Type: text/plain;charset=us-ascii\n\n")
-    os.Stdout.WriteString("Citation: \"" + quotes.Quotes[quote].Citation + "\"")
-    os.Stdout.WriteString("Author: \"" + quotes.Quotes[quote].Author + "\"")
-    os.Stdout.WriteString("Year: \"" + quotes.Quotes[quote].Year + "\"")
+    os.Stdout.WriteString("<html>\n<head>\n<title>GoQuotes</title>\n</head>\n")
+    os.Stdout.WriteString("<body>\n")
+    os.Stdout.WriteString("Citation: \"" + quote.Citation + "\"<br />\n")
+    os.Stdout.WriteString("Author: \"" + quote.Author + "\"<br />\n")
+    os.Stdout.WriteString("Year: \"" + quote.Year + "\"<br />\n")
+    os.Stdout.WriteString("</body>\n</html>")
 }
 
 // Main: you can specify here the location of quotes.