api to query callink api for organizations

also added .env for storing app id and key
add callink_id to club + category

also added callink_permalink + permalink to club model
callink_permalink is intended to be the unique slug identifier for the
club e.g. https://callink.berkeley.edu/organizations/<permalink>
Gemfile: don't require rest-open-uri

- rake db:migrate was not working because this gem was being required on
initialization. instead only require the Gem in club.rb

Error:
/Users/<user>/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/open-uri.rb:28:
stack level too deep (SystemStackError)

- additionally rest-open-uri version 1.0.0 was release in 2006 and hasn't
been updated since. Consider using OpenURI module

http://rubygems.org/gems/rest-open-uri
Club.sync_callink_groups with rspec tests

- fixed reverse order of CALLINK_API_KEY and CALLINK_APP_ID in
Callink::Organization.search
- xml files have no personal information
TODO: speed up tests
only sync callink orgs if response status is OK
change callink API url from https to http protocol

using https led to some issues with SSL, but the API just support HTTP

Errno::ECONNRESET (Connection reset by peer - SSL_connect)
http://stackoverflow.com/questions/15966446/errnoeconnreset-connection-reset-by-peer-ssl-connect
helper methods for a club to get facebook events

Currently only supports club with facebook pages
Also add scopes to query clubs with facebook_id, facebook_url, or
callink_id
assume clubs exist when adding callink events

when associating callink events with their club we assume that the event
exists

callink_events feature has been changed accordingly to reflect this
assumption

TODO: make sure that the rake task that import callink events and groups
imports the groups first
parse and save callink permalink in db
save facebook_id when importing facebook_events
methods to query facebook/callink events

to query: use Event.facebook or Event.callink

also added inflection methods so that an event can tell whether or not
it is a facebook or callink event

additionaly all callink events have a non-null callink_permalink
property
convenience methods to get events by time + range

includes methods to get events by day,  by datetime, or date range and
get events within the next week
clean facebook_url before Club validation

- Callink's organization api does not always have valid urls, which
motivates us to clean the url before validation. In our case, one of the
organization's facebok urls were duplicated so we extract the first valid url.

- validate facebook_url if facebook_url is present
rake api:sync task

the intent of having this rake task is to make sure that all
organization and event info is synchronized with facebook and other
various resources (events.berkeley.edu and callink.berkeley.edu)

Currently, running rake api:sync will retrieve all callink clubs and events for
clubs that have a facebook page

TODO: save events.berkeley.edu events
Note: facebook group events will only be synced when a user is logged in
and is browsing events
Merge branch 'feature-callink-orgs'