ea_sports_ppi 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_runtime_dependency "nokogiri"
24
+ spec.add_runtime_dependency "ruport"
24
25
  end
@@ -2,14 +2,22 @@ require "ea_sports_ppi/version"
2
2
 
3
3
  require 'nokogiri'
4
4
  require 'open-uri'
5
+ require 'ruport'
5
6
 
6
7
  module EaSportsPpi
7
8
  # Your code goes here...
8
9
  def self.run()
9
10
  doc=Nokogiri::HTML(open("http://www.premierleague.com/en-gb/players/ea-sports-player-performance-index/"))
10
11
  tables=doc.xpath('/html/body/div/div/div/div/div/div/div/form/div/table')
12
+ table = Ruport::Data::Table.new
13
+ table.column_names = %w[PLAYER INDEX]
11
14
  tables[0].xpath('tbody/tr').each do |tr|
12
- print(tr.xpath('td[4]').inner_text.strip, " ", tr.xpath('td[14]').inner_text.strip, "\n")
15
+ #print(tr.xpath('td[4]').inner_text.strip, " ", tr.xpath('td[14]').inner_text.strip, "\n")
16
+ array = Array.new
17
+ array << tr.xpath('td[4]').inner_text.strip
18
+ array << tr.xpath('td[14]').inner_text.strip
19
+ table << array
13
20
  end
21
+ puts table.to_text
14
22
  end
15
23
  end
@@ -1,3 +1,3 @@
1
1
  module EaSportsPpi
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ea_sports_ppi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-30 00:00:00.000000000 Z
12
+ date: 2013-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -59,6 +59,22 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: ruport
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
62
78
  description: show EA SPORTS PLAYER PERFORMANCE INDEX
63
79
  email:
64
80
  - wyukawa@gmail.com