Parsing JSON for Calendar Feed


(Jeremy Anderson) #1

I hate being a Hype noob, but if you don’t ask you’ll never learn. Anyhow, recently got help with parsing JSON and that was tremendous. Thanks again Hans, Mark and Johnathan.

I’m looking at parsing this URL:

https://www.menloschool.org/live/json/events/category/Athletics%20-%20Upper%20School/category/Athletics%20-%20Middle%20School/category_mode/any

This JSON request is for a calendar feed I am looking to build out. First, I need to filter out and only display items which are one week in the future or less. If event date is greater than 7 days, skip it.

I need to parse and display the following variables “Title”, “Location”, “Date”, “Date_time” for each event.

I want to show three items on a page at a time and then scroll to the next three items. At the end of the scroll of the last item, it should start at the top of the order of events again.

Very thankful for assistance on this…willing to trade beers or offer other technical services for any help here:)


(Mark Hunte) #2

Is this any different to the ticker tap Post?


(Jeremy Anderson) #3

Yes. This is indeed a little different as follows;

  1. Page need to be 955 x 900 pixels.
  2. I need to show three upcoming events at a time on the screen for 10 seconds. Then it cycles to the next 3 events. It needs to show only 1 weeks worth of events into the future.

I learned from the last one how to parse and display the variables but I don’t know how to filter out the events which are only 1 week out. Also not sure how to create the cycle of three events in perpetual loop.


(Mark Hunte) #4

It looks like you need to get the dates, which are in “date_utc”

You then use the date() to calculate if that date is a week from the current date. Do a google. You will get thousands of example and tutorials on this.