|
|
@ -31,6 +31,8 @@ func loreCheck(searchTerm, searchType string, redisClient *redis.Client) (string |
|
|
|
func loreNewString(nick, newString, newType string, redisClient *redis.Client) error { |
|
|
|
func loreNewString(nick, newString, newType string, redisClient *redis.Client) error { |
|
|
|
s := strings.SplitN(newString, " ", 2) |
|
|
|
s := strings.SplitN(newString, " ", 2) |
|
|
|
command, content := s[0], []byte(s[1]) |
|
|
|
command, content := s[0], []byte(s[1]) |
|
|
|
|
|
|
|
stripContent := strings.Replace(fmt.Sprintf("%s", content), "<", "", -1) |
|
|
|
|
|
|
|
stripLinks := strings.Replace(stripContent, ">", "", -1) |
|
|
|
|
|
|
|
|
|
|
|
t := time.Now() |
|
|
|
t := time.Now() |
|
|
|
|
|
|
|
|
|
|
@ -39,7 +41,7 @@ func loreNewString(nick, newString, newType string, redisClient *redis.Client) e |
|
|
|
|
|
|
|
|
|
|
|
// create the redis hash
|
|
|
|
// create the redis hash
|
|
|
|
_, err := redisClient.HMSet(fmt.Sprintf("%s:%s", newType, command), map[string]string{ |
|
|
|
_, err := redisClient.HMSet(fmt.Sprintf("%s:%s", newType, command), map[string]string{ |
|
|
|
"content": string(content), |
|
|
|
"content": stripLinks, |
|
|
|
"cdate": cdate, |
|
|
|
"cdate": cdate, |
|
|
|
"owner": nick, |
|
|
|
"owner": nick, |
|
|
|
}).Result() |
|
|
|
}).Result() |
|
|
|