impas-client 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  *.swp
2
2
  .DS_Store
3
3
  log/**/*
4
+ tmp/*
4
5
  tmp/**/*
5
6
  bin/*
6
7
  vendor/gems/*
@@ -0,0 +1,30 @@
1
+ require 'benchmark'
2
+ require 'CSV'
3
+ require 'impas-client'
4
+ require 'parallel'
5
+
6
+ client = Impas::Client.new({api_url:'http://impas-hideack.sqale.jp/'})
7
+
8
+ if ARGV.length != 3
9
+ puts "Usage:"
10
+ puts "ruby parse_tsv.rb [Parse target file] [Impas group key] [client threads]"
11
+ exit
12
+ end
13
+
14
+ puts "CSV Parse start. Target:#{ARGV[0]}"
15
+
16
+ targetUrls = []
17
+ CSV.foreach(ARGV[0], :col_sep=>"\t") do |row|
18
+ targetUrls << row
19
+ end
20
+
21
+ puts "CSV Parse finished."
22
+ puts "Impas post start."
23
+
24
+ puts Benchmark::CAPTION
25
+ puts Benchmark.measure{
26
+ Parallel.each(targetUrls, in_threads: ARGV[2].to_i) do |row|
27
+ client.add_url ARGV[1], row[1], row[0]
28
+ end
29
+ }
30
+
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_development_dependency 'rspec'
19
19
  gem.add_dependency "faraday", "~>0.8.4"
20
- gem.add_dependency "json", "~>1.7.3"
20
+ gem.add_dependency "json", "~>1.8.0"
21
21
  end
@@ -1,6 +1,6 @@
1
1
  module Impas
2
2
  class Client
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  API_URL = "http://impas-hideack.sqale.jp/"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: impas-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-07 00:00:00.000000000 Z
12
+ date: 2013-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 1.7.3
53
+ version: 1.8.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 1.7.3
61
+ version: 1.8.0
62
62
  description: Impas API client (Impas is social parameters crawling application.)
63
63
  email:
64
64
  - hide.terai@gmail.com
@@ -72,6 +72,7 @@ files:
72
72
  - LICENSE
73
73
  - README.md
74
74
  - Rakefile
75
+ - example/parse_tsv.rb
75
76
  - impas-client.gemspec
76
77
  - lib/impas-client.rb
77
78
  - lib/impas-client/version.rb