Number Laundry is a tiny API that accepts phone numbers and returns helpful information as json.
It's up and running with free access at http://numberlaundry.whatcheer.com/ but you can run your own copy with this source.
- PHP 5.3+
- A PDO compatible database
Install it!
Number Laundry uses the excellent Paris ORM which uses PDO, so a variety of databases should work. Keep in mind you will be running a table with 10k+ rows, so choose carefully. We use MySQL.
So, fire up your database and load db/schema.sql. Now, you have a choice to make. There is an existing db import at db/insert-2011-08-18.sql that you can load up. If that's too old you can use the script at generate.py to transform the JSON from Twilio into an insert statement (that will need tweaking). Either choice works, just have to pick one.
Upload the whole shebang to your web host (you can skip the db directory).
Now, move config.php.example to config.php and edit it to have the correct MySQL settings.
Additionally, move example.htaccess to .htaccess and make any necessary changes there as well.
Number Laundry is released under the MIT License (See LICENSE)
We needed clean phone numbers and Twilio international rates lookups for a project of ours called Bumble. We built something quickly and realized it was pretty handy. So, we decided it would be nice to provide this service to anyone else who needed it.
We're What Cheer, a web design and development studio located in Omaha, Nebraska. We make fancy websites.