Created
March 29, 2012 10:50
-
-
Save dannymcc/2235805 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add each row to a new call record | |
| page = agent.page.search("table tbody tr").each do |row| | |
| next if (!row.at('td')) | |
| time, source, destination, duration = row.search('td')[1..5].map{ |td| td.text.strip } | |
| call = Call.find_by_time(Time.parse(time)) | |
| call = Call.create_by_time(Time.parse(time)) | |
| call.update_attributes({:time => time, :source => source, :destination => destination, :duration => duration}) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment