usbank 0.0.0 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -1
  3. data/lib/usbank.rb +5 -8
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79faa6e122350da91356e900244e336d3bf98785
4
- data.tar.gz: 473d34612edaf5726e2453a259df9f856f9b5987
3
+ metadata.gz: 952bd1b96776d7d1bb743764602a8a3b1b52dd91
4
+ data.tar.gz: 767568144e6d759d8d24a5adac237cbeafcba99a
5
5
  SHA512:
6
- metadata.gz: 053942a3f3c273ee4098696452b914caa1a1ba56b126ee30fc37084fd12469b67b771b2ab5bdb8b108c99cd8dd51d05405cc85ab6dd71efe97187d1f3dc19f4d
7
- data.tar.gz: 612a1edb9e153657607f19c7dec381a3f74257c2d48d9599ebc2b3df8a039b5cfa8dfeadd4eb3f86bd6147dfdda76ab384f8b87f4bc645f0576944fde5faf316
6
+ metadata.gz: e4b2cb22bebc28b4b13212010b15835a5dbaddf93ab40523c4dbec513c641147419b181ce0682216ed0327439b20be02b024fa72f387bd7e9784854614605503
7
+ data.tar.gz: 006485cc42bdbc8c04c6f48e4b3146ae55989145693bdcf77d63b6da4fec385b5d4bd99eb47265bb73c9fd7b4d9987e0dd86965e02f3690455e11b6304ff70a0
data/README.md CHANGED
@@ -1,4 +1,28 @@
1
1
  usbank
2
2
  ======
3
3
 
4
- A gem to fetch usbank transaction data.
4
+ A gem to fetch usbank OFX transaction data. It signs into usbank.com with your credentials and downloads your account's OFX data.
5
+
6
+ Installation
7
+ ------------
8
+
9
+ Include the gem in your Gemfile:
10
+
11
+ ```ruby
12
+ gem "usbank"
13
+ ```
14
+
15
+ Usage
16
+ -----
17
+
18
+ ```ruby
19
+ usbank = Usbank.new(
20
+ username: 'johndoe',
21
+ password: 'alligator',
22
+ challenges: {
23
+ "What date did you get married?" => "021498",
24
+ "What was the name of your best friend in high-school?" => "Jane",
25
+ "What is your father's middle name?" => "Cornelius"
26
+ })
27
+ usbank.fetch # => String containing OFX data
28
+ ```
data/lib/usbank.rb CHANGED
@@ -15,24 +15,21 @@ class USBank
15
15
  @agent = Mechanize.new
16
16
 
17
17
  page = @agent.get 'https://www4.usbank.com/internetBanking/RequestRouter?requestCmdId=DisplayLoginPage'
18
- form = page.form_with :name => 'logon'
19
- form['USERID'] = username
18
+ form = page.forms.first
19
+ form['PersonalId'] = username
20
20
  page = form.submit
21
21
 
22
22
  form = page.forms.first
23
23
  question = (challenges).keys.find { |question| page.body.include? question }
24
24
  raise 'Challenge question not found' unless question
25
- form["CHALLENGEANSWER"] = challenges[question]
25
+ form["StepUpShieldQuestion.Answer"] = challenges[question]
26
26
  page = form.submit
27
27
 
28
28
  form = page.forms.first
29
- form["PSWD"] = password
29
+ form["password"] = password
30
30
  page = form.submit
31
31
 
32
- raise "SSO redirect not found after password submission." unless page.body =~ /MM SSO/i && page.forms.any?
33
- page = page.forms.first.submit
34
-
35
- raise "Dashboard not found after SSO redirect." unless page.body =~ /U.S. Bank - Customer Dashboard/i
32
+ raise "Accounts page not found after password submit." unless page.body =~ /My Accounts/i
36
33
  @dashboard_url = page.uri
37
34
  end
38
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usbank
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Lebert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-03 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  version: '0'
53
53
  requirements: []
54
54
  rubyforge_project:
55
- rubygems_version: 2.2.0
55
+ rubygems_version: 2.2.2
56
56
  signing_key:
57
57
  specification_version: 4
58
58
  summary: a gem to fetch transaction data from usbank