]> gitweb.factorcode.org Git - factor.git/commitdiff
google.search: Add fileFormat slot. Rename http-search to google-search
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 24 Jul 2012 21:09:29 +0000 (14:09 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 24 Jul 2012 21:09:29 +0000 (14:09 -0700)
extra/google/search/search.factor

index 0120459375919a90a7eac28878572793509704a4..ad2d8eea4c3af76b37cef3556170a4c94ddc3ffa 100644 (file)
@@ -23,11 +23,11 @@ IN: google.search
     new [ set-slots ] keep ;
 
 TUPLE: search-result cacheUrl GsearchResultClass visibleUrl
-title content unescapedUrl url titleNoFormatting ;
+title content unescapedUrl url titleNoFormatting fileFormat ;
 
 PRIVATE>
 
-: http-search ( query -- results )
+: google-search ( query -- results )
     search-url http-get nip json>
     { "responseData" "results" } deep-at
     [ \ search-result from-slots ] map ;
@@ -56,9 +56,9 @@ PRIVATE>
 
 PRIVATE>
 
-: http-search. ( query -- )
+: google-search. ( query -- )
     [ "Search results for '%s'" sprintf write-heading nl ]
-    [ http-search ] bi [
+    [ google-search ] bi [
         {
             [ titleNoFormatting>> write-title ]
             [ content>> write-content ]