Permalink
Browse files

chenge query param of atnd (count=50 → count=100)

  • Loading branch information...
1 parent d803246 commit a634a6a2861da33ef1d1cea888a653b5640209af hiroftp committed Apr 8, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −3 src/eventsearch/api.clj
  2. +3 −3 test/eventsearch/test_api.clj
View
@@ -2,13 +2,13 @@
(:use clj-http.util)
(:require [clj-http.client :as client]))
-(def events {"atnd" {:url "http://api.atnd.org/events/?format=json&count=50&" :key-param "keyword"}
+(def events {"atnd" {:url "http://api.atnd.org/events/?format=json&count=100&" :key-param "keyword"}
"zusaar" {:url "http://www.zusaar.com/api/event/?count=50&" :key-param "keyword"}
"partake" {:url "http://partake.in/api/event/search?sortOrder=deadline-r&maxNum=50&beforeDeadlineOnly=false&" :key-param "query"}
"doorkeeper" {:url "http://api.doorkeeper.jp/events.json?" :key-param "q"}
})
-(defn query-convert [s]
+(defn convert-query [s]
(->> (.replace s " " " ")
(re-seq #"[\S]+")
(map url-encode)
@@ -20,7 +20,7 @@
url (:url event)]
(if (empty? k)
url
- (str url (:key-param event) "=" (query-convert k)))))
+ (str url (:key-param event) "=" (convert-query k)))))
(defn search
([{k :keyword t :type} ]
@@ -3,9 +3,9 @@
eventsearch.api))
(deftest test-query-convert
- (is (= (query-convert "java clojure") "java,clojure"))
- (is (= (query-convert " java clojure ") "java,clojure"))
- (is (= (query-convert "java clojure haskell") "java,clojure,haskell")))
+ (is (= (convert-query "java clojure") "java,clojure"))
+ (is (= (convert-query " java clojure ") "java,clojure"))
+ (is (= (convert-query "java clojure haskell") "java,clojure,haskell")))
(deftest test-gen-url
(is (= (gen-url "clojure" "atnd" ) "http://api.atnd.org/events/?format=json&count=50&keyword=clojure"))

0 comments on commit a634a6a

Please sign in to comment.