coop_to_ofx 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/README.rdoc +38 -0
  2. data/Rakefile +141 -0
  3. data/bin/coop_to_ofx +60 -0
  4. data/lib/coop_scraper/base.rb +8 -0
  5. data/lib/coop_scraper/credit_card.rb +94 -0
  6. data/lib/coop_scraper/current_account.rb +92 -0
  7. data/lib/coop_scraper/version.rb +12 -0
  8. data/lib/coop_scraper.rb +2 -0
  9. data/lib/ofx/statement/base.rb +53 -0
  10. data/lib/ofx/statement/credit_card.rb +15 -0
  11. data/lib/ofx/statement/current_account.rb +14 -0
  12. data/lib/ofx/statement/output/base.rb +131 -0
  13. data/lib/ofx/statement/output/builder.rb +76 -0
  14. data/lib/ofx/statement/output/credit_card.rb +31 -0
  15. data/lib/ofx/statement/output/current_account.rb +29 -0
  16. data/lib/ofx/statement/transaction.rb +52 -0
  17. data/lib/ofx/statement.rb +3 -0
  18. data/lib/ofx.rb +1 -0
  19. data/spec/coop_scraper/base_spec.rb +15 -0
  20. data/spec/coop_scraper/credit_card_spec.rb +229 -0
  21. data/spec/coop_scraper/current_account_spec.rb +154 -0
  22. data/spec/fixtures/credit_card/cc_statement_fixture.html +927 -0
  23. data/spec/fixtures/credit_card/foreign_transaction_fixture.html +447 -0
  24. data/spec/fixtures/credit_card/interest_transaction_fixture.html +438 -0
  25. data/spec/fixtures/credit_card/maybe.txt +43 -0
  26. data/spec/fixtures/credit_card/merchandise_interest_fixture.html +0 -0
  27. data/spec/fixtures/credit_card/normal_transaction_fixture.html +439 -0
  28. data/spec/fixtures/credit_card/overlimit_charge_fixture.html +446 -0
  29. data/spec/fixtures/credit_card/payment_in_transaction_fixture.html +439 -0
  30. data/spec/fixtures/credit_card/simple_cc_statement.ofx +43 -0
  31. data/spec/fixtures/credit_card/statement_with_interest_line_fixture.html +452 -0
  32. data/spec/fixtures/current_account/cash_point_transaction_fixture.html +372 -0
  33. data/spec/fixtures/current_account/current_account_fixture.html +420 -0
  34. data/spec/fixtures/current_account/current_account_fixture.ofx +83 -0
  35. data/spec/fixtures/current_account/debit_interest_transaction_fixture.html +372 -0
  36. data/spec/fixtures/current_account/no_transactions_fixture.html +364 -0
  37. data/spec/fixtures/current_account/normal_transaction_fixture.html +372 -0
  38. data/spec/fixtures/current_account/payment_in_transaction_fixture.html +372 -0
  39. data/spec/fixtures/current_account/service_charge_transaction_fixture.html +372 -0
  40. data/spec/fixtures/current_account/transfer_transaction_fixture.html +372 -0
  41. data/spec/ofx/statement/base_spec.rb +116 -0
  42. data/spec/ofx/statement/credit_card_spec.rb +20 -0
  43. data/spec/ofx/statement/current_account_spec.rb +20 -0
  44. data/spec/ofx/statement/output/base_spec.rb +249 -0
  45. data/spec/ofx/statement/output/builder_spec.rb +38 -0
  46. data/spec/ofx/statement/output/credit_card_spec.rb +84 -0
  47. data/spec/ofx/statement/output/current_account_spec.rb +81 -0
  48. data/spec/ofx/statement/transaction_spec.rb +76 -0
  49. data/spec/spec.opts +2 -0
  50. data/spec/spec_helper.rb +36 -0
  51. metadata +172 -0
@@ -0,0 +1,372 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+
3
+
4
+
5
+ <html>
6
+ <head>
7
+ <TITLE>The Co-operative Bank p.l.c.</TITLE>
8
+ <link rel="stylesheet" href="https://welcome27.co-operativebank.co.uk/CBIBSImages/theme/Master.css" type="text/css">
9
+ <META content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
10
+ <META http-equiv="Content-Type" content="no-cache">
11
+ <META http-equiv="Pragma" content="no-cache">
12
+ <META http-equiv="Expires" content="-1">
13
+ <META http-equiv="Pragma-directive" content="no-cache">
14
+ <META http-equiv="cache-directive" content="no-cache">
15
+ </head>
16
+
17
+
18
+
19
+ <body>
20
+ <table width="100%" cellpadding="0" cellspacing="0">
21
+ <tr>
22
+ <td>
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+ <table width="100%" cellpadding="0" border="0" cellspacing="0">
31
+ <tr>
32
+ <td class="pageheader" height="0" width="50%">&nbsp;</td>
33
+ <td class="pageheader" width="20%">&nbsp;</td>
34
+ <td class="pageheader" height="10" width="30%">&nbsp;</td>
35
+ </tr>
36
+ <tr>
37
+ <td class="pageheader" valign="TOP" width="50%"><img src="https://welcome27.co-operativebank.co.uk/CBIBSImages/images/coop_logo_top.gif" align="left" alt="Top of the co-operative bank logo"></td>
38
+ <TD class="pageheader" valign="baseline" align="left" width="20%">
39
+ <table border="0" cellspacing="0" cellpadding="0" width="100%"><!--Table is used for vertical alignment-->
40
+ <tr><td>&nbsp;</td></tr>
41
+ <tr>
42
+ <TD class="pageheader" valign="BOTTOM" align="right" width="100%" height="100%">
43
+ <a href="/CBIBSWeb/sidebar.do?action=logoff&amp;org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Log Off" class="whiteLinks"><img src="https://welcome27.co-operativebank.co.uk/CBIBSImages/images/logoffbutton.gif" align="middle" alt="Log Off"></a>
44
+ </TD>
45
+ </tr>
46
+ </table>
47
+ </TD>
48
+
49
+ <TD class="pageheader" valign="baseline" align="left" width="35%">
50
+ <table border="0" cellspacing="0" cellpadding="0" width="100%"><!--Table is used for vertical alignment-->
51
+ <tr><td>&nbsp;</td></tr><!--Used for alignment-->
52
+ <tr>
53
+
54
+
55
+
56
+ <td class="pageheadernew" valign="baseline" width="22.5%"><a href="http://www.smile.co.uk/helppages/cbibs/statements/currentAccountPreviousStatements.htm" target="_blank" class="whiteLinks" title="New Help Window Opened">
57
+ <img src="https://welcome27.co-operativebank.co.uk/CBIBSImages/images/helpbutton.gif" align="left" alt="Help"></a></coop:HelpLinkTag>
58
+ </td>
59
+ <td class="pageheader" align="left" valign="baseline" width="77.5%"><a href="/CBIBSWeb/printstatementDomestic.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Printer Friendly Page" class="whiteLinks"><img src="https://welcome27.co-operativebank.co.uk/CBIBSImages/images/printbutton.gif" align="left" alt="Print"></a>
60
+ </td>
61
+
62
+
63
+
64
+ </tr>
65
+ </table>
66
+ </td>
67
+ </tr>
68
+ <tr align="left">
69
+ <td>
70
+ <table width="100%" border="0">
71
+ <tr>
72
+ <td align="left">&nbsp;&nbsp;</td>
73
+ <td align="left" valign="baseline" width="40%">Saturday 21 February 2009</td>
74
+ <td align="left" valign="baseline" width="60%"><span class="H4">MR M</span></td>
75
+ </tr>
76
+ <tr><td>&nbsp;</td></tr>
77
+ </table>
78
+ </td>
79
+ </tr>
80
+ </table>
81
+ </td>
82
+ </tr>
83
+ <tr valign="top" align="left">
84
+ <td class="sidebar" >
85
+ <table width="100%">
86
+ <tr valign="top" align="left">
87
+ <td width="20%" class="sidebar">
88
+
89
+
90
+
91
+
92
+
93
+
94
+ <table cellpadding="3" cellspacing="5" width="78%" border="0">
95
+ <tr>
96
+ <td valign="top" height="26"><br></td>
97
+ </tr>
98
+
99
+
100
+
101
+
102
+ <tr valign="top">
103
+ <td valign="top" class="sidebar">
104
+ <a href="/CBIBSWeb/backToAccountBalance.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Your Accounts" class="sidebar">Your Accounts</a>
105
+ </td>
106
+ </tr>
107
+
108
+
109
+
110
+
111
+ <tr valign="top">
112
+ <td valign="top" class="backgroundSelected">
113
+ <a href="/CBIBSWeb/prepareStatements.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Statements" class="sidebarSelected">Statements</a>
114
+ </td>
115
+ </tr>
116
+
117
+
118
+
119
+
120
+ <tr valign="top">
121
+ <td valign="top" class="sidebar">
122
+ <a href="/CBIBSWeb/billPaymentSummaryPrepare.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Pay Bills" class="sidebar">Pay Bills</a>
123
+ </td>
124
+ </tr>
125
+
126
+
127
+
128
+
129
+ <tr valign="top">
130
+ <td valign="top" class="sidebar">
131
+ <a href="/CBIBSWeb/standingOrderSummaryPrepare.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Standing Orders" class="sidebar">Standing Orders</a>
132
+ </td>
133
+ </tr>
134
+
135
+
136
+
137
+
138
+ <tr valign="top">
139
+ <td valign="top" class="sidebar">
140
+ <a href="/CBIBSWeb/fundsTransferSummaryPrepare.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Funds Transfers" class="sidebar">Funds Transfers</a>
141
+ </td>
142
+ </tr>
143
+
144
+
145
+
146
+
147
+ <tr valign="top">
148
+ <td valign="top" class="sidebar">
149
+ <a href="/CBIBSWeb/directDebitsSummaryPrepare.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Direct Debits" class="sidebar">Direct Debits</a>
150
+ </td>
151
+ </tr>
152
+
153
+
154
+
155
+
156
+ <tr valign="top">
157
+ <td valign="top" class="sidebar">
158
+ <a href="/CBIBSWeb/customerServicesSummary.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Customer Services" class="sidebar">Customer Services</a>
159
+ </td>
160
+ </tr>
161
+
162
+ <tr>
163
+ <td>&nbsp;</td>
164
+ </tr>
165
+ </table>
166
+ </td>
167
+ <td width="80%" class="sidebar" >
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
176
+ <tr>
177
+ <td class="field"><span class="H2">Statement<br>
178
+ </span></td>
179
+ </tr>
180
+ </table>
181
+
182
+ <table cellpadding="0" cellspacing="0" border="0" width="100%">
183
+ <tr>
184
+ <td bgcolor="#000000"><img src="https://welcome27.co-operativebank.co.uk/CBIBSImages/images/spacer.gif" height="1" width="1" alt=""></td>
185
+ </tr>
186
+ </table>
187
+
188
+ <table width="95%" border="0" cellspacing="0" cellpadding="0">
189
+ <tbody>
190
+ <tr><td><br/></td></tr>
191
+ <tr>
192
+ <td class="field">
193
+ <h4>CURRENT ACCOUNT
194
+ 08-92-73&nbsp;
195
+ 12341234
196
+ </h4>
197
+ </td>
198
+ </tr>
199
+
200
+
201
+
202
+ <tr>
203
+ <td align="left">
204
+ <table cellpadding="0" cellspacing="0" border="0">
205
+ <tbody>
206
+ <tr>
207
+ <td class="field">Page 132</td>
208
+ <td align="right">Date&nbsp;03/10/2008</td>
209
+ </tr>
210
+ <tr>
211
+ <td colspan="2"><br/>
212
+ </td>
213
+ </tr>
214
+ <tr>
215
+ <td colspan="2" align="left">
216
+ <table align="left" cellpadding="0" cellspacing="0" border="1">
217
+
218
+ <thead>
219
+ <tr>
220
+ <th>Date</th>
221
+ <th>Transaction</th>
222
+ <th>Deposits</th>
223
+ <th>Withdrawals</th>
224
+ <th>Balance</th>
225
+ </tr>
226
+ </thead>
227
+ <tbody>
228
+
229
+ <tr>
230
+ <td class="dataRowL"> 29/09/2008 </td>
231
+ <td class="transData">BROUGHT FORWARD</td>
232
+ <td class="moneyData"> &nbsp;</td>
233
+ <td class="moneyData"> &nbsp;</td>
234
+ <td class="moneyData"> £94.75 CR </td>
235
+ </tr>
236
+
237
+ <tr>
238
+ <td class="dataRowL"> 20/11/2008 </td>
239
+ <td class="transData">LINK 10:21NOV20</td>
240
+ <td class="moneyData"> &nbsp; </td>
241
+ <td class="moneyData"> £20.00 </td>
242
+ <td class="moneyData"> £151.09 CR </td>
243
+ </tr>
244
+
245
+ </tbody>
246
+
247
+ </table>
248
+ </td>
249
+ </tr>
250
+ <tr>
251
+ <td>&nbsp;</td>
252
+ </tr>
253
+ <tr>
254
+ <td colspan="2" align="right">
255
+
256
+ <a href="/CBIBSWeb/paginateDomesticStatement.do?paginate=next&amp;org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="next"><span class="bodyhighlight">next</span></a>
257
+
258
+ &nbsp; &nbsp;
259
+ <a href="/CBIBSWeb/paginateDomesticStatement.do?paginate=previous&amp;org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="previous"><span class="bodyhighlight">previous</span></a>
260
+
261
+ </td>
262
+ </tr>
263
+
264
+ </tbody>
265
+ </table>
266
+ </td>
267
+ </tr>
268
+
269
+ </tbody>
270
+ </table>
271
+ <table width="95%" cellspacing="0" cellpadding="0">
272
+
273
+ <tr>
274
+ <td class="field" colspan="2"><br/>
275
+ To view Recent Items click <a href="/CBIBSWeb/domesticRecentItems.do?org.apache.struts.taglib.html.TOKEN=2c0802b4f70aa7e54a0319cac03b7672" title="Recent Items"><span class="bodyhighlight">Recent Items</span></a>.<br>
276
+ </td>
277
+ </tr>
278
+ <tr>
279
+ <td class="field" colspan="2"><BR> To select another service click the menu on the left. <BR><BR>
280
+ </td>
281
+ </tr>
282
+ <tr>
283
+ <td>&nbsp;</td>
284
+ </tr>
285
+ <tr>
286
+ <td colspan="2" align="left"> To view another account, please select from the list below </td>
287
+ </tr>
288
+ </table>
289
+ </td>
290
+ </tr>
291
+ <tr valign="top" align="left">
292
+ <td></td>
293
+ <td align="left">
294
+
295
+
296
+
297
+ <form name="viewAccountForm" method="post" action="/CBIBSWeb/prepareDomesticStatements.do"><input type="hidden" name="org.apache.struts.taglib.html.TOKEN" value="2c0802b4f70aa7e54a0319cac03b7672">
298
+ <table cellpadding="0" cellspacing="0" border="0">
299
+ <tr>
300
+ <td><label for="accounts" class="nodisplay">accounts</label></td>
301
+ </tr>
302
+ <tr valign="bottom">
303
+ <td class="field" width="56%">
304
+ <select name="selectedAccount" id="accounts">
305
+ <option value ="Select Account">Select Account</option>
306
+ <option value ="%0892738810381900">CURRENT ACCOUNT 089273 12341234</option>
307
+
308
+ </select>
309
+ </td>
310
+ <td class="field">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
311
+ <input type="image" name="VIEW" src="https://welcome27.co-operativebank.co.uk/CBIBSImages/images/viewbutton.gif" title="view account" alt="view">
312
+ </td>
313
+ </tr>
314
+ <tr>
315
+ <td class="error" colspan="2"></td>
316
+ </tr>
317
+ <tr>
318
+ <td colspan="2">&nbsp;</td>
319
+ </tr>
320
+
321
+
322
+
323
+
324
+ <tr>
325
+ <td colspan="2" align="left"><strong><font color="#216173">IBAN :</font></strong> GB65 CPBK 0892 7312 3412 34
326
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
327
+ <strong><font color="#216173">BIC :</font></strong> CPBK GB 22
328
+ </td>
329
+ </tr>
330
+
331
+
332
+
333
+ <tr>
334
+ <td colspan="2">&nbsp;</td>
335
+ </tr>
336
+
337
+
338
+
339
+
340
+
341
+ <tr>
342
+ <td colspan="2" align="left">For details of charges for card transactions in any currency other than sterling click<a href="http://www.smile.co.uk/helppages/cbibs/foreigncardtransactions.html" target="_blank" class="whiteLinks" title="new help window opened">
343
+ <span class="bodyhighlight"> here</span></a>.</td>
344
+ </tr>
345
+
346
+
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+
356
+
357
+ </table>
358
+ </form>
359
+ </td>
360
+ </tr>
361
+ </table>
362
+ </td>
363
+ </tr>
364
+ <tr>
365
+ <td align="left"><table width="100%">
366
+ <tr><td/>
367
+ </tr>
368
+ </table></td>
369
+ </tr>
370
+ </table>
371
+ </body>
372
+ </html>