Dynamic iCal subscription question.

Home Forums Calendar Products Events Calendar PRO Dynamic iCal subscription question.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #999849
    Anthony D’Arco
    Participant

    I am trying to put a calendar (http://stanneschoolbarrington.org/events/) in my iCal. I found the forum topic, that said, I can subscribe from ical using this link: http://stanneschoolbarrington.org/events/ical.

    I have put that in, and it seems to “read” the url properly, however, it doesn’t seem to load the whole calendar into my ical. It DID load the next weeks worth of events, however, it stopped there.

    I was wondering if I’m just doing something wrong, or if this is bug.

    #1000002
    George
    Participant

    Hey Anthony!

    Thanks for reaching out. I’m curious, when you say that it loaded the next week’s worth of events, can you specify what actual number of events were imported? Was it 20 or 21, for example?

    I’m only asking to try and pin down the problem – the iCal file generated at http://stanneschoolbarrington.org/events/ical contains 21 events, so if all 21 events were imported then we at least know that the events importing the file fine, and it’s the generated file itself that we need to fix.

    But if, say, only 5 events were imported over the course of the next week, then there’s a problem with the importer itself and not necessarily with the generated file.

    Does that distinction make sense? Let me know what you think and what number of events were imported when you used that http://stanneschoolbarrington.org/events/ical URL, we can continue troubleshooting from there.

    Thanks!
    George

    #1000010
    Anthony D’Arco
    Participant

    Great questions. You’re right, it did import all 21 events were imported. So it appears as though there is a problem with the ical export because there should have been significantly more (there are a lot, like well over 100 on the calendar).

    Thank you,
    Anthony

    #1000654
    George
    Participant

    Hey Anthony,

    Thanks for reporting back on this (and for your patience over the weekend! 🙂 )

    How exactly did you export that iCal file? We may not be able to help much, here, if this is a third-party exporter like exporting directly from Google Calendar or Outlook or something. Let me know!

    Thanks,
    George

    #1002199
    Anthony D’Arco
    Participant

    Sorry,

    I totally missed this email. I’m a bit confused about what you are looking for. I am using iCal to subscribe to the Event Calendar. So, the Event Calendar is creating the ics file. Google and Outlook aren’t involved. I guess to clarify:

    I opened iCal
    I went to File -> Subscribe to New Calendar
    I inserted this link: http://stanneschoolbarrington.org/events/ical

    Make sense? It is worth noting (and this might just be a setting, but it has now imported all of September’s events). So, it appears to only be updating iCal one month at a time.

    Thank you,
    Anthony

    #1002941
    George
    Participant

    Hey Anthony,

    No need to apologize at all – in fact, I sorry for here for misunderstanding your issue so thoroughly. Sorry about that! I appreciate your update and your clarification of things within it.

    One thing left that’s worth clarifying is exactly how many events are all being imported…for example, you wrote this up above in your second post on this thread:

    So it appears as though there is a problem with the ical export because there should have been significantly more (there are a lot, like well over 100 on the calendar).

    If you have 100 events in the month of September alone, then there is indeed a problem in some sense and all 100 should be getting pulled in. If, however, those 100 events are over the whole year, and only 21 events are in September, then the importing of only those 21 events is not the result of an issue.

    Further, the iCal “feed” is not quite a “feed” but actually just an auto-generated .ics file. So, as you noted, this will update on a monthly basis, instead of a true “feed” that is just a real-time stream of new content – does this distinction make sense?

    I appreciate your patience with this issue and with my misunderstanding of things at first – hopefully we’re converging on some common ground here though, which I hope is the case so I can actually be helpful! 🙂

    In closing, I’m wondering if you can clarify exactly what you meant in your last note here:

    It is worth noting (and this might just be a setting, but it has now imported all of September’s events). So, it appears to only be updating iCal one month at a time.

    This seems to be in line with the functionality I described above – in other words, that:

    • The events/ical “feed” URL is really an endpoint for a generated, static .ics file, not a real-time stream of new events.
    • This feed is a month-by-month thing, so if you have 100 events all year but only 21 events in September then only those 21 events will be in the .ics file for September.

    I hope this all helps – let me know what your thoughts are on all of this and if I can help with anything else!

    Thanks,
    George

    #1003016
    Anthony D’Arco
    Participant

    George,

    Yes, your explanation makes perfect sense. I also think that there may not be an issue in the sense that it is doing what it is designed to do. Meaning if the intent is that it only ever updates one month at a time, then it does appear that it is working perfectly. Then, my question is, is there a way that it can keep a whole year (or calendar) in synch instead of just one month at a time? If not, is there any expectation that it ever will?

    Let me know if that makes sense.

    Thank you,
    Anthony

    #1003400
    George
    Participant

    Thanks for your patience with things here Anthony, I’m sorry that after all of this back-and-forth things essentially don’t even seem to be broken to begin with!

    As for your other questions:

    Then, my question is, is there a way that it can keep a whole year (or calendar) in synch instead of just one month at a time?

    This is possible, but I dug into the code behind all this and it’s unfortunately a pretty extensive code change to do this and it’s not something you can do from inside your theme’s functions.php file – in other words, you’d have to head into the core plugin classes and make changes, which means that every time you update The Events Calendar you’d have to re-implement these changes.

    Is that something you’re interested in? I can elaborate on technical details if so, otherwise I’ll hold off for simplicity’s sake.

    If not, is there any expectation that it ever will?

    There is not a current plan for this but I think a very solid case can be made for adding some filters to the core code behind all this stuff just so that it’s easier to change for users, if they’re interested in making such changes. I will pass this along to our development time, it’s excellent feedback Anthony. Thank you!

    #1003487
    Anthony D’Arco
    Participant

    George,

    No I don’t really like making customizations to core files. I would love to see if the developer are interested in adding that to the plugin. I think it makes a ton of sense to be able to change the date range imported. ESPECIALLY because when it gets to the end of the month, it doesn’t automatically import that next months until the 1st of that month. (that is actually my biggest problem with the mini calendar — If there is an event on the 1st, and its the 30th, it won’t display).

    Anyway, thank you for all your help, and let me know if this is something that might make it to core.

    #1003552
    Andy Fragen
    Moderator

    Just a thought but it seems that if the subscribe to iCal feature would create and ics file with the next 2 months of data, then every time iCal refreshes a current next 2 months of data would be present.

    George, I’m certainly willing to dig into core to help figure this out.

    #1004221
    George
    Participant

    Hey Anthony,

    I agree that this should be much easier to change and will vocalize support for this with our development team.

    And Andy, if you’re willing to do that, that is awesome! I can leave this thread open for a bit of time if you would like, but our Support Droid might auto-close it after 15 days of inactivity.

    I’m sorry that the results of this thread are somewhat disappoint, Anthony – please stay tuned to plugin updates because this is an area we can definitely improve, and if we add more features to adjust all this, it will be noted in the “Changelog” of the plugin update readme files.

    Cheers!
    George

    #1004229
    Anthony D’Arco
    Participant

    No worries, I am not so much disappointed as I am glad I have a much clearer understanding of how it works.

    Thank you,
    Anthony

    #1004486
    Andy Fragen
    Moderator

    Hey George,

    Is that something you’re interested in? I can elaborate on technical details if so, otherwise I’ll hold off for simplicity’s sake.

    Want to get technical? 🙂

    #1004575
    George
    Participant

    Want to get technical? 🙂

    Hey Andy (and Anthony, if you’re interested!),

    I’ll mostly refrain from doing so here for the sake of bringing Anthony’s support thread to a close, but here’s a general roadmap of where the feed is generated from, which should provide a solid base for further exploration and tinkering if you’re interested in that – which I know you are! 😀

    1. Tribe__Events__iCal::generate_ical_feed() – this is, as the method name implies, where the rubber hits the road and the actual feed content is generated.
    2. Tribe__Events__iCal::get_month_view_events() – this is a private method that the above method calls, and as its name implies, this gets the month’s events. This method’s inner workings dictate much of the nuances of event retrieval that I shared with Anthony above, i.e. you’ll see that its query parameters have ‘posts_per_page’ set to -1 which means “get all events”, BUT it’s still limited by month, so “all” really means “all in this month”.
    3. Tribe__Events__Template__Month::calculate_first_cell_date
    4. Tribe__Events__Template__Month::calculate_final_cell_date()
    5. The tribe_ical_feed_month_view_query_args() filter – this filter uses the two methods in #3 and #4 above, which tell The Events Calendar what a month actually is – i.e. these two methods above are what define “September 2015” as starting on Tuesday Sept. 1 and ending on Wednesday Sept. 30, respectively. Using this filter is how you could in theory tweak the iCal feed generation code to reach beyond Sept. 30, but it’s a bit trickier than it might seem to get this to work consistently and solidly.

    So that’s the sort of “tree” of calls and code that generate all this relevant stuff. I hope that’s helpful for tinkerers and explorers out there 🙂

    Cheers!
    George

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Dynamic iCal subscription question.’ is closed to new replies.