usbank 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -1
- data/lib/usbank.rb +5 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 952bd1b96776d7d1bb743764602a8a3b1b52dd91
|
4
|
+
data.tar.gz: 767568144e6d759d8d24a5adac237cbeafcba99a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
19
|
-
form['
|
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["
|
25
|
+
form["StepUpShieldQuestion.Answer"] = challenges[question]
|
26
26
|
page = form.submit
|
27
27
|
|
28
28
|
form = page.forms.first
|
29
|
-
form["
|
29
|
+
form["password"] = password
|
30
30
|
page = form.submit
|
31
31
|
|
32
|
-
raise "
|
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.
|
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-
|
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.
|
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
|