bank_scrap 0.0.2 → 0.0.3

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: 68b5810bd6747ebe4b3f073747092768f5d16019
4
- data.tar.gz: 413f9dc6ab905d1c5ec32de0bd3bb76a0a84025f
3
+ metadata.gz: 0a37e0cd7f424b6fcd7be561a34ea7990060f41a
4
+ data.tar.gz: 5f14a99961d2b82846a51c55d7df5f817e2e87b5
5
5
  SHA512:
6
- metadata.gz: 6fc2147bb41666fcfc2cceb6f571dd7ae517ad398c117b38c650c8119b78c450b32471e9f98c6569c1e934ecd02985a6b31ebf2b70661c533a9c943b8e171de2
7
- data.tar.gz: fa7b34b93ef33f86f005ba79f6d46533b15c4eda928945d45eb08307e6b64946fec77dd6eaba08f4c93907fe889e416d4310372179aed311c97ac8cdaea78853
6
+ metadata.gz: ef3a7d2ccc0312098bb22a5e70fbf5a31f768cd9c72fbe208691965886aff8d143a7c1532766d68fff2cb8487a961f05fabf828d6a9fdd5849d751c066a7b55c
7
+ data.tar.gz: b92c5292be30ec7f56e9e5e361e8d6be65c4528d4f33fc24bedfe91493f3fe697cf164c14798c6517b331083c15c4db932bd27ca5d284334886e4c9e5d46f27f
data/README.md CHANGED
@@ -2,13 +2,28 @@
2
2
 
3
3
  Ruby gem to extract balance and transactions from banks. You can use it either as command line tool or as a library.
4
4
 
5
- The aim of this project is to build a library which interacts with some of the most used banks. We already know how boring is to look for your balance on the web, so let's do it with the command line.
6
-
7
5
  Feel free to contribute and add your bank if it isn't supported.
8
6
 
9
7
  ## Supported banks
10
8
  - Bankinter
11
- - BBVA
9
+ - BBVA (only balance, transactions soon)
10
+
11
+ Work in progress:
12
+ - ING
13
+
14
+ Interested in any other bank? Open a new Issue and we'll try to help.
15
+
16
+ ## Background and motivation
17
+
18
+ Most banks don't offer public APIs and the only way to access your data (balance and transactions) is through their websites... and most bank websites are a f*cking nightmare.
19
+
20
+ We are developers and we don't want to waste time doing things we are able to automate. Having to perform 20 clicks in an awful website just to check how much money we have is not something we like.
21
+
22
+ There are two approaches to solve this problem:
23
+ - Web scraping on the bank's site.
24
+ - Reverse engineering the bank's mobile app to use the same API the app uses.
25
+
26
+ Bankscrap uses both methods depending on the bank.
12
27
 
13
28
  ## Requirements
14
29
 
@@ -16,31 +31,52 @@ Some banks needs a JavaScript runtime in order to work. So if you find an error
16
31
 
17
32
  ## Installation
18
33
 
19
- Add this line to your application's Gemfile:
34
+ ### From Git
20
35
 
21
- ```ruby
22
- gem 'bank_scrap'
23
- ```
36
+ You can check out the latest source from git:
37
+
38
+ git clone git://github.com/ismaGNU/bank_scrap
39
+
40
+ ### From RubyGems
24
41
 
25
- And then execute:
42
+ Installation from RubyGems:
26
43
 
27
- $ bundle
44
+ gem install bank_scrap
28
45
 
29
- Or install it yourself as:
46
+ Or, if you're using Bundler, just add the following to your Gemfile:
30
47
 
31
- $ gem install bank_scrap
48
+ gem 'bank_scrap'
32
49
 
33
50
  ## Usage
34
51
 
52
+ ### From terminal
35
53
  Retrieve balance account
36
54
 
37
55
  $ bank_scrap balance BANK_NAME --user YOUR_USER --password YOUR_PASSWORD
38
56
 
39
57
  BANK_NAME should be in underscore case (`bankinter`, `bbva`).
40
58
 
59
+ ### From Ruby code
60
+
61
+ You can also use this gem from your own app as library. To do so first you must initialize a Bankscrapper::Bank object
62
+
63
+ ```ruby
64
+ require 'bank_scrap'
65
+ @bank = BankScrap::Bbva.new(YOUR_BBVA_USER, YOUR_BBVA_PASSWORD)
66
+ ```
67
+
68
+ (Replace Bbva with your own bank)
69
+
70
+ Now you can fetch your balance:
71
+
72
+ ```ruby
73
+ @bank.get_balance
74
+ ```
75
+
76
+
41
77
  ## Contributing
42
78
 
43
- 1. Fork it ( https://github.com/[my-github-username]/bankscrap/fork )
79
+ 1. Fork it ( https://github.com/ismaGNU/bank_scrap/fork )
44
80
  2. Create your feature branch (`git checkout -b my-new-feature`)
45
81
  3. Commit your changes (`git commit -am 'Add some feature'`)
46
82
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,4 +1,3 @@
1
-
2
1
  require 'nokogiri'
3
2
  require 'execjs'
4
3
 
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  module BankScrap
2
4
  class Bbva < Bank
3
5
  BASE_ENDPOINT = 'https://bancamovil.grupobbva.com'
@@ -1,3 +1,3 @@
1
1
  module BankScrap
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/bank_scrap.rb CHANGED
@@ -2,9 +2,9 @@ require 'bank_scrap/version'
2
2
  require 'bank_scrap/cli'
3
3
  require 'bank_scrap/bank'
4
4
 
5
- # TODO: load banks dynamically
6
- require 'bank_scrap/banks/bankinter'
7
- require 'bank_scrap/banks/bbva'
8
-
9
5
  module BankScrap
6
+ # autoload only requires the file when the specified
7
+ # constant is used for the first time
8
+ autoload :Bankinter, 'bank_scrap/banks/bankinter'
9
+ autoload :Bbva, 'bank_scrap/banks/bbva'
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank_scrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ismael Sánchez
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-11-01 00:00:00.000000000 Z
14
+ date: 2014-11-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler