SHARE
TWEET

Untitled

Kuzminov Mar 8th, 2020 (edited) 379 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'csv'
  2. require 'faker'
  3.  
  4. company_list = %w[Kuzminov\ Inc. Kuzminov\ University]
  5.  
  6. CSV.open('leads.csv', 'w+') do |csv|
  7.   csv << [
  8.     'Distributor Company Name',
  9.     'Email',
  10.     'Full name',
  11.     'Country',
  12.     'Trade Show',
  13.     'Trade Show Year',
  14.     'Description',
  15.     'Company name',
  16.     'Company department',
  17.     'Phone Number',
  18.     'Position',
  19.     'State',
  20.     'City',
  21.     'Zip',
  22.     'VAT number',
  23.     'Address1',
  24.     'Address2',
  25.     'Contact Phone',
  26.     'Web Site',
  27.     'Did you met this customer for a demo',
  28.     'Demonstration Place',
  29.     'Demonstration Date',
  30.     'Demonstration Duration',
  31.     'Exhibition',
  32.     'Place',
  33.     'Exhibition Date',
  34.     'Comments'
  35.   ]
  36.   company_list.each do |name_distr|
  37.     5.times do |index|
  38.       csv << [
  39.         name_distr,
  40.         # "email#{index+1}@rubytut#{index+1}.com",
  41.         '1@yandex.ru',
  42.         "#{Faker::Name.name} #{index + 1}",
  43.         Faker::Address.country,
  44.         # "United States",
  45.         # 'Slovenia',
  46.         'AM Expo (Additive Manufacturing Expo)',
  47.         rand(2007..2019),
  48.         "Description #{index}",
  49.         Faker::Company.bs.capitalize,
  50.         'Head Company department',
  51.         "+7911111111#{index}",
  52.         Faker::Job.position,
  53.         Faker::Address.state_abbr,
  54.         # "#{Faker::Address.state}",
  55.         Faker::Address.city,
  56.         Faker::Address.zip_code,
  57.         "DE#{rand(999_999_900..999_999_999)}",
  58.         Faker::Address.full_address,
  59.         "#{Faker::Address.street_address}#{index}",
  60.         "#{Faker::PhoneNumber.cell_phone}#{index}",
  61.         "www.#{Faker::Name.last_name.downcase}.#{Faker::Internet.domain_suffix}",
  62.         %w(Yes No).sample,
  63.         Faker::Address.street_name,
  64.         "2019-11-#{rand(10..30)}",
  65.         "#{index} hours",
  66.         "Exhibition #{index + 2}",
  67.         Faker::Address.community,
  68.         "2019-12-#{rand(10..31)}",
  69.         Faker::Book.title
  70.       ]
  71.     end
  72.   end
  73. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top