repositories
/
cloogle-irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad6f64c
)
Better no results response (resolves #3)
author
Camil Staps
<info@camilstaps.nl>
Tue, 12 Sep 2017 20:38:13 +0000
(22:38 +0200)
committer
Camil Staps
<info@camilstaps.nl>
Tue, 12 Sep 2017 20:38:13 +0000
(22:38 +0200)
cloogleirc.icl
patch
|
blob
|
history
diff --git
a/cloogleirc.icl
b/cloogleirc.icl
index
0fc25f9
..
c9a464e
100644
(file)
--- a/
cloogleirc.icl
+++ b/
cloogleirc.icl
@@
-56,7
+56,7
@@
shorten s w
cloogle :: String *World -> (String, *World)
cloogle data w
cloogle :: String *World -> (String, *World)
cloogle data w
-# (mer, w) = doHTTPRequest
L
+# (mer, w) = doHTTPRequest
FollowRedirects
{ newHTTPRequest
& req_path = "/api.php"
, req_query = "?str=" + urlEncode data
{ newHTTPRequest
& req_path = "/api.php"
, req_query = "?str=" + urlEncode data
@@
-67,6
+67,7
@@
cloogle data w
# resp = fromOk mer
= case fromJSON $ fromString resp.HTTPResponse.rsp_data of
Nothing = ("couldn't parse json", w)
# resp = fromOk mer
= case fromJSON $ fromString resp.HTTPResponse.rsp_data of
Nothing = ("couldn't parse json", w)
+ Just {return=127} = ("No results for " + data, w)
Just clr = ("Results for " + data + " -- https://cloogle.org/#" +
replaceSubString "+" "%20" (urlEncode data) + "\n" +
processResults clr, w)
Just clr = ("Results for " + data + " -- https://cloogle.org/#" +
replaceSubString "+" "%20" (urlEncode data) + "\n" +
processResults clr, w)