Skip to content

A simple Rails app that takes a CSV of phone numbers and runs a Twilio Lookup.

License

Notifications You must be signed in to change notification settings

cweems/twilio-bulk-lookup

Repository files navigation

NOT SUPPORTED OR MAINTAINED BY TWILIO, USE AT YOUR OWN RISK.

Bulk Lookup for Twilio

Twilio lookup allows you to determine if a phone number is a mobile number or a landline. This project allows you to upload a CSV, run a bulk lookup, and then download a CSV with information from the Lookup API.

Heroku Prerequesites

Before you start, you'll need the following:

Heroku Setup

Deploy

You can also clone this repository and run the app locally. See the Local Setup section.

  1. Create your first admin user via the command line:

Heroku:

$ heroku run rails console
> AdminUser.create(email: '[email protected]', password: 'your_pass', password_confirmation: 'your_pass')
  1. twilio-bulk-lookup uses Redis for queueing paralell requests. You will need to have redis installed in your environment:

Heroku: heroku addons:create heroku-redis:hobby-dev

  1. Visit your heroku application and log in using the credentials you entered above.

  2. Add your Twilio Credentials screen shot 2018-07-25 at 4 42 01 pm

  3. Import your CSV of Phone Numbers on the Contacts Page screen shot 2018-07-25 at 4 35 10 pm

  4. Click the bulk lookup button on the Dashboard Page screen shot 2018-07-25 at 4 35 34 pm

  5. Wait for your lookup to process. It will take rougly 1 hour to process 4,000 contacts.

  6. Download your results from the Contacts Page as a CSV, TSV, or Excel. screen shot 2018-07-25 at 4 45 14 pm

Local Setup

For one-time use or customization, local development may be a better option. Follow this sequence of commands to set up the twilio-bulk-lookup app locally:

# Use rails 2.7.5:
rvm install 2.7.5
rvm use 2.7.5

# Clone the repository:
git clone [email protected]:cweems/twilio-bulk-lookup.git

# Install dependencies:
bundle install

# Set up database:
rake db:create
rake db:migrate
rake db:seed

# Install Redis using homebrew (Mac, or see https://redis.io/topics/quickstart):
brew install redis

# Start redis in a new CLI window:
redis-server

# Start the sidekiq worker in a new CLI window:
bundle exec sidekiq -c 2

# Start the application in a new CLI window:
rails s

Open http://localhost:3000 to view the app locally.

rake db:seed creates an admin user with the following credentials that you can use to log in:

You can also create your own local admin user like this:

$ rails console
> AdminUser.create(email: '[email protected]', password: 'your_pass', password_confirmation: 'your_pass')