Toot title is less important (h3), decode url query for tag, use account handle instead of username
This commit is contained in:
parent
8aad570ab4
commit
ce86ff0386
2
main.go
2
main.go
|
@ -38,7 +38,7 @@ type Config struct {
|
|||
type Account struct {
|
||||
Id string `json:"id"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Name string `json:"username"`
|
||||
Name string `json:"acct"`
|
||||
Url string `json:"url"`
|
||||
}
|
||||
|
||||
|
|
11
server.go
11
server.go
|
@ -292,6 +292,17 @@ func printTag(conn *tls.Conn, baseURL, tag string) {
|
|||
return
|
||||
}
|
||||
|
||||
//decode tag (url encoded char like space)
|
||||
tag, err = url.QueryUnescape(tag)
|
||||
if err != nil {
|
||||
_, err = fmt.Fprintf(conn, "59 Invalid url encoded tag\r\n")
|
||||
if err != nil {
|
||||
log.Println("handleConn: %s", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Print header
|
||||
_, err = fmt.Fprintf(conn, "20 text/gemini\r\n# Toots for %s\n", tag)
|
||||
if err != nil {
|
||||
|
|
2
util.go
2
util.go
|
@ -99,5 +99,5 @@ func formatBlog(toot Blog) string {
|
|||
author = toot.Author.DisplayName
|
||||
}
|
||||
|
||||
return "## Written by " + author + " on " + toot.Date[0:10] + " at " + toot.Date[11:16] + "\n" + content
|
||||
return "### Written by " + author + " on " + toot.Date[0:10] + " at " + toot.Date[11:16] + "\n" + content
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue