X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=cloogle.icl;h=a7a428ea34cd28402b890735676e2915688c34fa;hp=29cee8056d1a4ce513878379658490f1563132cc;hb=663ea3d6dfb6a70ddf1f3b6c41d4d39ed30c4440;hpb=f828f3a79cfcfb21c6c7a7773905cc210a739f75 diff --git a/cloogle.icl b/cloogle.icl index 29cee80..a7a428e 100644 --- a/cloogle.icl +++ b/cloogle.icl @@ -29,8 +29,8 @@ import TCPIP commands :: [String] commands = map toString - [NICK "clooglebot" - ,USER "cloogle" 0 "Cloogle bot" + [NICK "clooglebot" Nothing + ,USER "cloogle" "0" "Cloogle bot" ,JOIN [("#cloogle", Nothing)] ] @@ -132,7 +132,7 @@ cloogle data w # resp = fromOk mer = case fromJSON $ fromString resp.HTTPResponse.rsp_data of Nothing = ("couldn't parse json", w) - Just clr = ("Results for " + data + " -- https://cloogle.org/#" + urlEncode data + "\n" + + Just clr = ("Results for " + data + " -- https://cloogle.org/#" + replaceSubString "+" "%20" (urlEncode data) + "\n" + processResults clr, w) where processResults :: Response -> String @@ -184,8 +184,8 @@ recv {sChannel,rChannel} w | rpt == TR_NoSuccess || isNothing resp = abort "Halp?\n" = (toString <$> resp, {sChannel=sChannel,rChannel=rChannel}, w) -msg :: (String -> IRCCommands) -msg = PRIVMSG "#cloogle" +msg :: (String -> IRCCommand) +msg = PRIVMSG ["#cloogle"] process :: *File TCP_DuplexChannel *World -> (*File, TCP_DuplexChannel, *World) process io chan w