[Groonga-commit] ranguba/ranguba-crawler at 349a8de [master] Show only important information

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Mar 1 23:13:49 JST 2017


Kouhei Sutou	2017-03-01 23:13:49 +0900 (Wed, 01 Mar 2017)

  New Revision: 349a8de1eb4bc48d8f10c42f7ce4d8f96489f7bd
  https://github.com/ranguba/ranguba-crawler/commit/349a8de1eb4bc48d8f10c42f7ce4d8f96489f7bd

  Message:
    Show only important information

  Modified files:
    lib/ranguba-crawler/command.rb

  Modified: lib/ranguba-crawler/command.rb (+15 -7)
===================================================================
--- lib/ranguba-crawler/command.rb    2017-02-25 00:39:29 +0900 (5ad7e9e)
+++ lib/ranguba-crawler/command.rb    2017-03-01 23:13:49 +0900 (f5e1454)
@@ -41,13 +41,21 @@ module RangubaCrawler
           if @suffix
             next unless path.extname == @suffix
           end
-          response = Net::HTTP.post_form(api_uri,
-                                         {
-                                           "uri" => path_to_uri(path),
-                                           "body" => path.open("rb", &:read),
-                                         })
-          p response
-          pp JSON.parse(response.body)
+          parameters = {
+            "uri" => path_to_uri(path),
+            "body" => path.open("rb", &:read),
+          }
+          response = Net::HTTP.post_form(api_uri, parameters)
+          case response
+          when Net::HTTPSuccess
+            # pp(JSON.parse(response.body))
+          else
+            puts("Failed to request: #{response.code}")
+            puts(path)
+            # puts(api_uri)
+            # pp(parameters.inspect)
+            # puts(response.body)
+          end
         end
       end
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index