Created
November 8, 2010 01:47
-
-
Save jason/667287 to your computer and use it in GitHub Desktop.
This file contains 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
# Helper methods defined here can be accessed in any controller or view in the application | |
Emparse.helpers do | |
def logindata(login, password, spreadkey) | |
session = GoogleSpreadsheet.login(login, password) | |
ws = session.spreadsheet_by_key(spreadkey).worksheets[0] | |
fname = [] | |
lname = [] | |
address = [] | |
for row in 2..ws.num_rows | |
fname[row] = ws[row, 1].downcase.strip | |
lname[row] = ws[row, 2].downcase.strip | |
address[row] = ws[row, 5].sub('www.', '') | |
puts "#{fname[row]}.#{lname[row]}@#{address[row]}" | |
puts "#{fname[row]}@#{address[row]}" | |
puts "#{lname[row]}.#{fname[row]}@#{address[row]}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment