SchedulesDirect / JSON-Service

Code related to download, slice-and-dice and generation of JSON into database.
36 stars 5 forks source link

You have requested a schedule which is not in any of your configured lineups. #65

Closed bbigras closed 9 years ago

bbigras commented 9 years ago

1: get status

curl --header "token: <mytoken>" https://json.schedulesdirect.org/20141201/status

{
  "account": {
    "expires": "2016-01-27T18:09:30Z",
    "messages": [],
    "maxLineups": 4
  },
  "lineups": [
    {
      "lineup": "CAN-0004268-DEFAULT",
      "modified": "2015-07-11T18:49:20Z",
      "uri": "/20141201/lineups/CAN-0004268-DEFAULT"
    },
    {
      "lineup": "CAN-0005993-X",
      "modified": "2015-07-18T04:43:47Z",
      "uri": "/20141201/lineups/CAN-0005993-X"
    }
  ],
  "lastDataUpdate": "2015-07-27T17:19:14Z",
  "notifications": [],
  "systemStatus": [
    {
      "date": "2015-03-23T18:47:00Z",
      "status": "Online",
      "message": "Lineup responses updated. See http://forums.schedulesdirect.org/viewtopic.php?f=17&t=2645&p=8379 for details."
    }
  ],
  "serverID": "20141201.web.1",
  "code": 0
}

2: get lineup

curl --header "token: <mytoken>" https://json.schedulesdirect.org/20141201/lineups/CAN-0005993-X

{"map":[{"stationID":"14786","channel":"010"}...

3 : get md5

curl --header "token: <mytoken>" -X POST -d '[{"stationID": "14786", "date": ["2015-07-27"]}]' https://json.schedulesdirect.org/20141201/schedules/md5

{
  "14786": {
    "2015-07-27": {
      "code": 7030,
      "message": "You have requested a schedule which is not in any of your configured lineups.",
      "lastModified": "1970-01-01",
      "md5": "CAFEDEADBEEFCAFEDEADBE"
    }
  }
}
rkulagowski commented 9 years ago

That's odd. I will check to see why it's tagging the station as not in your lineup when it is.

rkulagowski commented 9 years ago

Can you test now? There was a misplaced else.

bbigras commented 9 years ago
{
  "14786": {
    "2015-07-27": {
      "code": 0,
      "message": "OK",
      "lastModified": "2015-07-27T17:05:20Z",
      "md5": "Yh7DTySVZHTM9O9nr+F3FA"
    }
  }
}

It works but there's a small problem. The lastModified's format is not the same when there's an error and when there's none. If the format is the same it's easier to decode using a struct.

rkulagowski commented 9 years ago

On Mon, Jul 27, 2015 at 2:22 PM, Bruno Bigras notifications@github.com wrote:

It works but there's a small problem. The lastModified's format is not the same when there's an error and when there's none. If the format is the same it's easier to decode using a struct.

Should be fixed now.

bbigras commented 9 years ago

Nice, thanks!