From f351b4819da25d32de4608a5ec4e9e63463cba06 Mon Sep 17 00:00:00 2001 From: Sean Hinchee Date: Wed, 31 Jan 2018 07:29:10 +0000 Subject: [PATCH] fixed a bug in man url processing. switched to man.postnix.us. (thanks lewellyn?) --- x/mux/man.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x/mux/man.go b/x/mux/man.go index 3f4ec1899d3a8cc1e322b76158cd208fd16a4228..e012bd9992d79e27c98a5e7738769407f639f9a8 100644 --- a/x/mux/man.go +++ b/x/mux/man.go @@ -33,9 +33,14 @@ func (m *Mux) Man(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) { page += ctx.Fields[len(ctx.Fields)-1] // Should allow selection of manual categories beyond 9front - url := "http://man.cat-v.org/9front/" + section + "/" + page + url := "http://man.postnix.us/9front/" + section + "/" + page page, err := http.Get(url) + if err != nil { + fmt.Println("Error fetching URL, see: x/mux/man.go") + resp += "Error fetching URL. Is man.postnix.us up?" + goto URL + } defer page.Body.Close() body, err := ioutil.ReadAll(page.Body) @@ -54,7 +59,7 @@ func (m *Mux) Man(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) { for i:=1; i < 9; i++ { // Should allow selection of manual categories beyond 9front - url := "http://man.cat-v.org/9front/" + strconv.Itoa(i) + "/" + page + url := "http://man.postnix.us/9front/" + strconv.Itoa(i) + "/" + page page, err := http.Get(url) defer page.Body.Close() @@ -86,6 +91,7 @@ func (m *Mux) Man(ds *discordgo.Session, dm *discordgo.Message, ctx *Context) { resp += "No op. Please use the 'man 3 srv' format or 'man srv' format." } + URL: resp += "\n" _, err = ds.ChannelMessageSend(dm.ChannelID, resp)