IFPA Calendar in iCal format

So I have been hacking away on my C# / .NET implementation of an IFPA API data wrapper, found here

And one of the uses I thought would make the most sense is a way for the IFPA calendar to be integrated into my iOS phone calendar or Google Calendar. So I whipped up a quick API that consumes IFPA calendar info and outputs .ics data. Using this ICS data you can add it to your iCloud or Google calendars via the following url format

http://pinballcalendar20170829102021.azurewebsites.net/api/calendar/{address}/{distanceInMiles}

Example: Show me events 250 miles from Providence, RI

http://pinballcalendar20170829102021.azurewebsites.net/api/calendar/Providence/250

To add this event to your google calendar, go to calendar.google.com and click the dropdown menu near ā€˜Other Calendarsā€™ and add by url, crafting your url like above.

On an iOS device you can go into Settings -> Calendar and go to accounts, add a new one, and choose ā€˜otherā€™, then choose subscribed calendar and punch in the URL. I am still working out bugs so if you see them, feel free to send me a PM or post here. Iā€™ll be putting the website on github in a separate project as well.

10 Likes

whoa. very cool!

1 Like

Definitely not perfect though. I might consider finding a way to filter leagues/ongoing events as they arenā€™t super helpful in iOS

This is actually awesome.

1 Like

This is really cool, but I did find an issue for leagues like above. Hereā€™s an example URL.

http://pinballcalendar20170829102021.azurewebsites.net/api/calendar/Nashville/150

It appears that a league event has dates that span the entire league calendar, not just league event dates?

1 Like

Yeah. Thatā€™s the way the IFPA calendar actual page does it too right?

Leagues are a special case. What I might do is hide all events that have League in their name or that are larger than 4 days long.

What I could do is for items that have League in the title and / or items that are longer than 4 days (unlikely to be a single ā€˜eventā€™), just show the event in the calendar on the last day.

Viewing the Nashville calendar page on IFPA I donā€™t actually see the league you are referring to?
https://www.ifpapinball.com/calendar/

Why not show it on the first day instead of the last? That way, someone in Nashville - for example - will see the first date of the event and ā€œ5 weeksā€ in the description and can manually edit the calendar item to repeat weekly for five weeks.

(I havenā€™t loaded your ical in my calendar, but I assume it includes the description)

Well, I think because the last day is more likely to be the tournament finals? I can implement however makes the most sense, or provide query string parameters to allow people to customize the calendar output for however people see fit. I need to get this project into github tonight so people can post issues.

I guess I just assumed that people need to play in the events leading up to the final, and they might miss those if only the final is on their calendar. But yeah, whatever makes most sense!

Iā€™ve published the very small web project here on github

Iā€™ve also added a ā€˜showLeagues=falseā€™ querystring option to hide anything with ā€˜leagueā€™ in the name or that spans more than 3 days of play.

Example:
http://pinballcalendar20170829102021.azurewebsites.net/api/calendar/Providence/250?showLeagues=false

omitting that parameter will default to true / aka showing leagues

Iā€™ve completed the C# / .NET pinball api wrapper, it should be feature complete (covers all IFPA endpoints as well as providing rudimentary data from IPDB from machine data lookup).

Available on Nuget

Iā€™m pretty happy with the calendar. I think my next project will be a cross platform mobile app for IFPA. Thatā€™s very ambitious so probably wonā€™t be anytime soon, but I would love for my phone to alert me when my rank has changed or nearby tournaments are happening.

2 Likes

For anyone interested in this kind of thing, some time ago I also made a PHP wrapper for the IFPA API way back around the time it launched. I never did much with it but it would be cool for someone to pick it up and take care of it.

Great idea! I tried this but unfortunately didnā€™t work in OS X Calendar. I used the variables Adelaide/800 and got the following error from Calendar:

"Access to ā€œPinball HQ Tournamentā€ in ā€œcalendar (1)ā€ in account ā€œiCloudā€ is not permitted.

The server responded:
ā€œ403ā€
to operation CalDAVWriteEntityQueueableOperation."

Pinball HQ Tournament is a tournament in Sydney.

1 Like

Thanks @onetaste for the feedback. I googled that error and I believe its due to the Organizer field set to the TDā€¦ apparently MacOS/Calendar is very strict about the organizer field. Iā€™ve omitted that field, can you remove and try to re-add the calendar and let me know if it works?

1 Like

Works perfectly on Mac Calendar now, thank you!!!

1 Like

I have been using this for a month now and I really like it, i use it to tell me about local tournaments I compete in regularly and also for all tournaments around australia so that when I travel I can try and time it with a tourney. Thanks for putting this together.

1 Like

Thanks dude! Iā€™m happy itā€™s being used. I updated the libraries a bit to make them .NET standard; hopefully the next step is a cross platform IFPA app. Check back years from now :smile: