Part of ATX Hack for Change 2014
Problem: Currently, real-time online information on lost / found pets is difficult to find and use, prolonging pet and owner separation and taking up valuable shelter space in Austin, a no-kill city.
Project: Create a tool that periodically scrapes pet recovery postings and saves them to a database that can be searched via a web tool and will push notifications to interested parties.
Pet Harbor and the Austin Animal Center are the sole datasources of the app as of now - we are retrieving data by performing regular API requests against the Austin data portal for new found animals, and running constant reconciliations with our database. The feeder is not part of the Rails application (this repository) - instead, the Rails app has an API that provides access to update our database of missing animals, and external scripts are handling the nasty business of scraping external sources. The current Pet Harbor feeder is a Ruby script using soda to access the data.
Notifications are being sent to subscribers via email and text message for any new animals logged on AAC.
NOTE: We temporarily discourage the use of vagrant for this project - it's too slow to be feasible.
- Make sure you have Ruby 2.1.3 installed (RVM or rubyenv make this easy)
- Make sure you have Bundler installed
$ git clone git@github.com:open-austin/pet-finder.git
$ bundle install
$ rake db:migrate
$ rails server
- Visit localhost:3000 to view the site in the browser.
-
Make sure you have VirtualBox installed.
-
Make sure you have vagrant installed.
-
$ git clone git@github.com:open-austin/pet-finder.git
-
$ vagrant up
-
Note that you will likely have to enter your password at some point to enable NFS - this is bypassable by
source
ing the following from vagrant's docs:Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE
-
-
Visit localhost:3000 to view the site in the browser.
We are using Figaro to manage secret configuration settings - all this means for you is that you should create an application.yml file in config/ that looks like the following:
GMAIL_USERNAME: [working gmail address]
GMAIL_PASSWORD: [working gmail password]
http_username: username
http_password: password
aws_key: [request a key]
aws_secret: [request a secret]
s3_bucket: pet-alert-dev
plivo_auth_id: auth-id
plivo_auth_token: auth-token
plivo_number: 1231231234
All emails are sent from a background service called Sidekiq that will be installed alongside the rest of the gems - however, Sidekiq requires redis in order to function properly.
- Install redis
$ redis-server
$ bundle exec sidekiq -q notifier -q default
We are using Plivo to send SMS messages - if you need to test this locally, you will need to request an auth id and token from us. Generally, this shouldn't be necessary - the message sending part of the app is taken care of.
To contribute, fork this repo and submit pull requests for merges. All updates should have accompanying tests (we use RSpec), and should ensure that all existing tests are passing. We are still establishing coding standards and practices, so do your best to contribute code that is as consistent as possible with things now.