cobalt-uoft / cobalt

Open data APIs for interfacing with public information from the University of Toronto.
https://cobalt.qas.im
MIT License
98 stars 20 forks source link

Add Athletics API #58

Closed kashav closed 8 years ago

kashav commented 8 years ago

Some filter examples:

/1.0/athletics/filter?q=title:"rock climbing" AND date:"2016,04,04"

[
  {
    "id":"04SC",
    "date":"2016-04-04T00:00:00.000Z",
    "campus":"UTSC",
    "events":[...],
    "matched_events":[{
      "title":"Rock Climbing Club",
      "location":"Climbing Wall",
      "building_id":"208",
      "start_time":"2016-04-04T18:00:00.000Z",
      "end_time":"2016-04-04T20:30:00.000Z"
    }]
  }
]

/1.0/athletics/filter?q=start:<"2016,04,01,12"

[
  {
    "id":"01M",
    "date":"2016-04-01T00:00:00.000Z",
    "campus":"UTM",
    "events":[...],
    "matched_events":[{
      "title":"Length Swim",
      "location":"Pool",
      "building_id":"332",
      "start_time":"2016-04-01T11:00:00.000Z",
      "end_time":"2016-04-01T13:00:00.000Z"
    }]
  }
]

https://github.com/cobalt-uoft/cobalt/issues/57

kashav commented 8 years ago

Not too sure why that test was failing, passed when I tested locally. Removed for the time being.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.07%) to 99.524% when pulling 698666503f814a9c8c2a2a4a895e15106a66a7f4 on kshvmdn:athletics-api into 7bdad15dc98fe2058d9a1dbe596147a8c81e428b on cobalt-uoft:master.

qasim commented 8 years ago

I'll start testing this first thing tomorrow. From my first glance it's looking good!

qasim commented 8 years ago

I'm guessing there's no nice way to have the date outputted localized for Eastern timezone? I see Mongo converts it to the zero-offset UTC.

kashav commented 8 years ago

I think something like this could work.

We'd just subtract the offset from the datetime when converting date strings (after importing the dataset).

qasim commented 8 years ago

Let's leave it as is for now and can revisit later. I've a feeling we'll run into more datetime problems as the project progresses. GG time.