Specifically, you??™ll create a chart that will graphically display
the amount of weekend expenses compared to weekday expenses.
Note that once the data has been loaded into MySQL, you could easily modify your
script to perform other calculations, such as to determine where you spend the most
money.
For this example, you??™ll need FasterCSV, Active Record, and Markaby installed. You
can install the required gems with the following commands:
gem install fastercsv active_record markaby
To read data from the CSV file, you??™ll use FasterCSV, which is a fast CSV parsing
library for Ruby. We??™ll take a closer look at FasterCSV next, before beginning the example.
Markaby is a markup library for Ruby. It lets you represent HTML using Ruby code. You
can find more information about Markaby at http://markaby.rubyforge.org/.
CHAPTER 7 n TRACKING EXPENDITURES WITH PAYPAL 136
nTip If you don??™t want to have an additional dependency, you can also parse CSV using Ruby??™s built-in CSV
module, although it will be slower.
Pages:
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202