Smile Bank to Ledger

Check-in [dae330504e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Report out available balance as well
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dae330504e3cd754372d973d75ad24d7368df6f2
User & Date: atomicules 2015-07-21 09:26:30
Context
2015-07-21
15:30
Include balance as balance assertion on last transaction instead of as comment check-in: 04aa81bd2e user: atomicules tags: trunk
09:26
Report out available balance as well check-in: dae330504e user: atomicules tags: trunk
08:51
Use highline for secure data entry¬ check-in: 04f262a3df user: atomicules tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to smile.rb.

8
9
10
11
12
13
14

15
16
17
18
19
20
21
..
75
76
77
78
79
80
81
82

83
84
85
86
87
88
89
...
143
144
145
146
147
148
149

150
151
152
153
154
155
156
end
optparse.parse!

class Smile
	attr_writer :date_back 
	attr_reader :transactions
	attr_reader :balance


	def initialize
		@a = Mechanize.new
		@transactions = []
	end


................................................................................

	def recent_transactions
		#requires
		page = logon_bulletin
		page = @a.click(page.link_with(:text => "current account"))
		get_transactions(page)
		doc = Nokogiri::HTML(page.body)
		@balance = doc.xpath("//td[@class='recentTransactionsAccountData']/table/tr[2]/td[2]").text

		#Need to return this
		page
	end


	def previous_statements
		#requires
................................................................................
				end
				file << "\t"+"Assets:Smile:Current"+"\t"+amount+"\n"
				file << "\t"+type+"\n"
				file << "\n"
			end
			#Write out account balance as a comment at the end
			file << "#Balance: "+@balance+"\n"

		end
	end

	private :logon_start
	private :logon_passcode
	private :logon_other
	private :logon_bulletin







>







 







|
>







 







>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
end
optparse.parse!

class Smile
	attr_writer :date_back 
	attr_reader :transactions
	attr_reader :balance
	attr_reader :available

	def initialize
		@a = Mechanize.new
		@transactions = []
	end


................................................................................

	def recent_transactions
		#requires
		page = logon_bulletin
		page = @a.click(page.link_with(:text => "current account"))
		get_transactions(page)
		doc = Nokogiri::HTML(page.body)
		@balance = doc.xpath("//td[@class='recentTransactionsAccountData']/table/tr[2]/td[2]").text.strip
		@available = doc.xpath("//td[@class='recentTransactionsAccountData']/table/tr[3]/td[2]").text.strip
		#Need to return this
		page
	end


	def previous_statements
		#requires
................................................................................
				end
				file << "\t"+"Assets:Smile:Current"+"\t"+amount+"\n"
				file << "\t"+type+"\n"
				file << "\n"
			end
			#Write out account balance as a comment at the end
			file << "#Balance: "+@balance+"\n"
			file << "#Available: "+@available+"\n"
		end
	end

	private :logon_start
	private :logon_passcode
	private :logon_other
	private :logon_bulletin