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'
fix m2m between category and club

Originally there were 2 one-to-many relationships:
    1. A club has many category
    2. A category has many clubs

However, this did not correctly reflect many-to-many relationship between
categories and clubs.

Say Club 1 has category_id set to 1.
Say Category 1 has the club_id to something else.

When I get Category 1's clubs, Club 1 will be among the clubs. However
when I query Club 1's categories, Category 1 will not be there since
Category 1's club_id is set to something else.

The following resources were referenced to make the necessary changes
such that a many to many relationship between category and club exists:

http://railscasts.com/episodes/47-two-many-to-many
http://guides.rubyonrails.org/association_basics.html#the-has-many-through-association
Added pagination feature to events
Added passing test to the pagination feature
store facebook event cover url + location

- add facebook_pic_cover and location fields
- store facebook event cover url as string
- store location as string

more info at https://developers.facebook.com/docs/reference/fql/event

- rake task now also retrieves this extra information
- make sure feature to get facebook page events passes
  (getFbEventAndSave.rb)
Merge branch 'master' into style-branch-JM