fine_ants 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 071fd57f7af644d446d6ebcb23ee806b1035caf9
4
- data.tar.gz: 6d546e676ff383d2e3a64630dd3ec5242c0c59e6
3
+ metadata.gz: 7a6db23ef2b3811bc70236763970ad82b5aa1549
4
+ data.tar.gz: 1716b20642df703db7145a448d10f7d10b2fa59f
5
5
  SHA512:
6
- metadata.gz: 143e892128f919a23587e25bc74f314255cc133814a8fb5d4e42328b208876ebac57bc8560219e80f5c79fb7e8e4625d5ce2907108370fe58db32e6145d7bdba
7
- data.tar.gz: ac5d4192b60073153573890b5698ed26a213ebb054cd69b733fa02f7e770116a2e1a44ae40ef0c7c1d0e7ad264b7dcafe6508550af54cd3b15206bb9d39fedd6
6
+ metadata.gz: 2750ebb301abf3c697d584118b268e93a27c55907471d689b5be3f1e26a1384eaf6b710b3abe616205b4b3eb7c6b826517ce2514b5715f1c25573a35f6a5e150
7
+ data.tar.gz: 5d1747d3d15c4130a442851b8438cf1f9edea6354c8d4da60531a132ce5a4f9b6f6cf598ef03428182360dfa81b3b04ece08d71bdc8a2dbe40a992f89dd44097
data/README.md CHANGED
@@ -62,11 +62,13 @@ Right now, FineAnts ships with adapters for:
62
62
  | [Vanguard Personal Investment](https://personal.vanguard.com/us/hnwnesc/nesc/LoginPage) | `:vanguard` |
63
63
  | [PNC Personal Banking](https://www.pnc.com/en/personal-banking.html) | `:pnc` |
64
64
  | [Betterment](https://www.betterment.com) | `:betterment` |
65
+ | [E*Trade](https://www.etrade.com) | `:etrade` |
65
66
  | [Chase](https://www.chase.com) | `:chase` |
66
67
  | [Simple (BBVA)](https://www.simple.com) | `:simple` |
67
68
  | [Simple (Bancorp)](https://www.simple.com) | `:simple_bancorp` |
68
69
  | [Target REDcard](https://rcam.target.com) | `:target` |
69
70
  | [Purdue Federal Credit Union](https://www.purduefed.com) | `:purduefed` |
71
+ | [Ohio State Teacher Retirement System (STRS)](https://www.nrsstrsoh.org) | `:strs` |
70
72
 
71
73
  You can also implement your own adapter and pass it to `FineAnts.download`. The
72
74
  expected public contract of an adapter is:
@@ -13,11 +13,24 @@ module FineAnts
13
13
  fill_in "web_authentication[email]", :with => @user
14
14
  fill_in "web_authentication[password]", :with => @password
15
15
  click_button "Log in"
16
+ begin
17
+ find_field "web_second_factor_authentication[verification_code]"
18
+ return false
19
+ rescue Capybara::ElementNotFound
20
+ verify_login!
21
+ return true
22
+ end
23
+ end
24
+
25
+ def two_factor_response(answer)
26
+ fill_in "web_second_factor_authentication[verification_code]", :with => answer
27
+ find(".web_second_factor_authentication_trust_device").click
28
+ click_button "Verify"
16
29
  verify_login!
17
30
  end
18
31
 
19
32
  def download
20
- accounts = all(".sub-account")
33
+ accounts = all(".SummaryTable-card")
21
34
  accounts.map do |account|
22
35
  {
23
36
  :adapter => :betterment,
@@ -27,30 +40,31 @@ module FineAnts
27
40
  :amount => total_for(account)
28
41
  }
29
42
  end.tap do
30
- find(".dropdown .user-option").click
31
- click_button "Log Out"
43
+ find('.sc-Nav-panelTrigger').click
44
+ find('.sc-Nav-panelTrigger').click
45
+ find('.sc-Nav-panelTrigger .SecondaryNavLogoutAction button', visible: false).click
32
46
  end
33
47
  end
34
48
 
35
49
  private
36
50
 
37
51
  def verify_login!
38
- find ".total-balance"
52
+ find ".Dashboard-summaryCards"
39
53
  rescue
40
54
  raise FineAnts::LoginFailedError.new
41
55
  end
42
56
 
43
57
  def id_for(account)
44
- link = account.find(".donut-label a")
58
+ link = account.find(".SummaryTable-donutContainer a")
45
59
  link[:href].match(/\/app\/goals\/(\d+)\//)[1]
46
60
  end
47
61
 
48
62
  def name_for(account)
49
- "#{account.find(".type-and-plan").text} - #{account.find(".goal-name").text}"
63
+ "#{account.find(".SummaryTable-accountName .SummaryTable-label").text} - #{account.find(".SummaryTable-accountName .u-secondaryHeading").text}"
50
64
  end
51
65
 
52
66
  def total_for(account)
53
- total_string = account.find(".current-balance h3").text
67
+ total_string = account.find(".SummaryTable-rightAlignedText .u-secondaryHeading").text
54
68
  BigDecimal.new(total_string.match(/\$(.*)$/)[1].gsub(/,/,''))
55
69
  end
56
70
  end
@@ -0,0 +1,46 @@
1
+ require "bigdecimal"
2
+
3
+ module FineAnts
4
+ module Adapters
5
+ class Etrade
6
+ def initialize(credentials)
7
+ @user = credentials[:user]
8
+ @password = credentials[:password]
9
+ end
10
+
11
+ def login
12
+ visit "https://us.etrade.com/e/t/user/login"
13
+ fill_in "User ID", :with => @user
14
+ fill_in "Password", :with => @password
15
+ click_button "Log on"
16
+ verify_login!
17
+ end
18
+
19
+ def download
20
+ all("section.account").map do |account|
21
+ {
22
+ :adapter => :etrade,
23
+ :user => @user,
24
+ :id => account.find("#acctNum .number-reveal", :visible => false).text(:all),
25
+ :name => account.find("a.account-id").text,
26
+ :amount => BigDecimal.new(account.find(".table-horizontal .text-right.secondary").text.gsub(/[\$,]/,''))
27
+ }
28
+ end.tap do
29
+ click_link "Log Off"
30
+ end
31
+ end
32
+
33
+ private
34
+
35
+ def verify_login!
36
+ find_link "Log Off"
37
+ rescue
38
+ raise FineAnts::LoginFailedError.new
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+
45
+
46
+
@@ -0,0 +1,65 @@
1
+ require "bigdecimal"
2
+
3
+ module FineAnts
4
+ module Adapters
5
+ class Strs
6
+ def initialize(credentials)
7
+ @user = credentials[:user]
8
+ @password = credentials[:password]
9
+ end
10
+
11
+ def login
12
+ visit "https://www.nrsstrsoh.org/iApp/tcm/nrsstrsoh/index.jsp"
13
+ fill_in "Username", :with => @user
14
+ fill_in "Password (Case sensitive)", :with => @password
15
+ click_button "Log In"
16
+ begin
17
+ find_field "contactPoint"
18
+ return false
19
+ rescue Capybara::ElementNotFound
20
+ verify_login!
21
+ return true
22
+ end
23
+ end
24
+
25
+ def two_factor_response(answer)
26
+ fill_in "confirmationCode", :with => answer
27
+ find_field("continue").click
28
+ begin
29
+ find "#rememberTrue"
30
+ choose "#rememberTrue"
31
+ find_field("#search").click
32
+ rescue Capybara::ElementNotFound
33
+ end
34
+ verify_login!
35
+ end
36
+
37
+ def download
38
+ [
39
+ {
40
+ :adapter => :strs,
41
+ :user => @user,
42
+ :id => find(".plan-info-plan .disabled-phone-link").text,
43
+ :name => find(".plan-info-plan").text,
44
+ :amount => BigDecimal.new(find(".dash-health-alt__total_number").text.gsub(/[\$,]/,''))
45
+ }
46
+ ].tap do
47
+ click_link "Log Out"
48
+ end
49
+ end
50
+
51
+ private
52
+
53
+ def verify_login!
54
+ find(".dash-health-alt__current_total_balance")
55
+ rescue
56
+ raise FineAnts::LoginFailedError.new
57
+ end
58
+ end
59
+ end
60
+ end
61
+
62
+
63
+
64
+
65
+
@@ -11,7 +11,7 @@ module FineAnts
11
11
  def login
12
12
  visit "https://personal.vanguard.com/us/hnwnesc/nesc/LoginPage"
13
13
  fill_in "LoginForm:USER", :with => @user
14
- fill_in "LoginForm:PASSWORD", :with => @password
14
+ fill_in "LoginForm:PASSWORD-blocked", :with => @password
15
15
  click_button "LoginForm:submitInput"
16
16
  begin
17
17
  find_field "LoginForm:ANSWER"
@@ -1,3 +1,3 @@
1
1
  module FineAnts
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fine_ants
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -99,10 +99,12 @@ files:
99
99
  - lib/fine_ants/adapters.rb
100
100
  - lib/fine_ants/adapters/betterment.rb
101
101
  - lib/fine_ants/adapters/chase.rb
102
+ - lib/fine_ants/adapters/etrade.rb
102
103
  - lib/fine_ants/adapters/pnc.rb
103
104
  - lib/fine_ants/adapters/purduefed.rb
104
105
  - lib/fine_ants/adapters/simple.rb
105
106
  - lib/fine_ants/adapters/simple_bancorp.rb
107
+ - lib/fine_ants/adapters/strs.rb
106
108
  - lib/fine_ants/adapters/target.rb
107
109
  - lib/fine_ants/adapters/vanguard.rb
108
110
  - lib/fine_ants/capybara_setup.rb