Google calendar issues – No venue details, wrong end date
WordPress Event Management, Calendars & Registration › Forums › iCal Extension › Google calendar issues – No venue details, wrong end date
This topic contains 9 replies, has 2 voices, and was last updated by Stephen Harris 8 years, 10 months ago.
-
AuthorPosts
-
January 27, 2016 at 11:19 am #20985
I have purchased the iCal extension and events are coming into EO from a Google Calendar iCal feed.
The main problem is that no venue data is coming across.
Example google calendar event (on Google):
https://calendar.google.com/calendar/render?eid=OGgwZTBvNmZzZW8xYjQ3aGM5MWQxcDdmMWsgZmlzaGVyaWVzc2NvdGxhbmRAbQ&ctz=Europe/London&sf=true&output=xml#eventpage_6Same event on our dev site: http://ifm-live.consil.co.uk/events/event/sfcc-biologists-meeting/
Though I’d prefer the venue to be added as an EO venue, an acceptable fallback would be to add the location info to the event description
Another issue is that the end time in the EO event is wrong. In the EO event the end date is 04-02-2016 and ‘all day’ is ticked.
The google event actually ends: Fri, February 5, 12amAlso, is it possible to grab the ‘created by’ email address so we can display that as contact details in the EO event?
Thanks
Dan BradyJanuary 27, 2016 at 11:15 pm #20999Hi Dan,
Unfortunately the iCal specification doesn’t provide for venue details. It only includes a ‘LOCATION’ attribute, which is a free value. If you, however, you know that the value for the LOCATION attribute will have a specific structure you could ‘tell’ Event Organiser how to interpret it (see the importing venue information section on this page: http://docs.wp-event-organiser.com/importing-events/importing-events-from-an-ical-feed/).
As for the event end time – could you provide an example iCal feed?
Stephen HarrisJanuary 28, 2016 at 11:21 am #21001Thanks Stephen
The iCal feed we’re using is:
https://calendar.google.com/calendar/ical/fisheriesscotland%40gmail.com/public/basic.icsI’ll take a look at that link. Unfortunately the location address structure is not consistent. It would be good to have a regular expression that looks for UK postcodes and uses them to generate the Google map. We’ve written such a regular expression for other purposes, if you want us to share it with you?
Also when the Google map data is empty, I’m seeing a google map with a pin in the sea somewhere.
Is there a way to disable the google map when no map location is entered?Dan BradyJanuary 28, 2016 at 11:41 am #21002As en example about the google calendar, here’s a venue:
http://ifm-live.consil.co.uk/events/venues/birnam-dunkeld-perth-and-kinross-ph8-uk/
All the location data is in the venue title field, and the venue’s address fields are empty.
Ideally the postcode would be identified by regex and entered into the address data. Also, if no address data is present, the plugin shouldn’t try to show a map.Any ideas about the event date issues?
Dan BradyJanuary 28, 2016 at 1:44 pm #21003After looking into this further, I can see that the approach I suggested (pulling postcode data from the venue title into the postcode field) will probably not work.
It appears that the Events Organiser venue interface does a real time Google Maps lookup, which brings back the latitude & longitude values, which are then saved against the venue.
I assume that this lookup only happens in the admin screen GUI. Therefore the iCal feed would need to pass the lat & long values, which obviously it doesn’t have.
Is there a way of getting the lat & long without going to the venue admin GUI screen? It would be nice if EO had a fallback where if the address fields are empty, it passes the venue title to Google and the lat&long values are then saved against the venue. Hope this makes sense.
Dan BradyJanuary 28, 2016 at 4:12 pm #21008Ok, we’ve edited the EO event and venue templates to hide the google map when a venue has no lat/long data.
My colleague Jason will send you a pull request on GitHub
Dan BradyJanuary 28, 2016 at 4:58 pm #21011Dan BradyJanuary 28, 2016 at 10:28 pm #21015Hi Dan,
Thanks for the pull request.
I forgot to mention in my last post that iCal feeds can specify latitude/longitude co-ordinates (the GEO property of a event). Event Organiser does support this but it unfortunately Google doesn’t appear to include this their iCal feeds.
Regarding the event being imported as an all-day event, this is how it is specified in the iCal feed. The event you linked to (SFCC Biologist’s Meeting) has this at line 629:
DTSTART;VALUE=DATE:20160203
As you can see, it is specifying a date rather than a datetime which indicates it’s an all-day event. A datetime would appear as (for example)
DTSTART:20160203T000000
I’ve tried creating similar events in Google and they all export correctly (that is, contain the time component when they should do) so I’m not sure why you’re Google feed is giving a date rather than datetime.
It appears that the Events Organiser venue interface does a real time Google Maps lookup, which brings back the latitude & longitude values, which are then saved against the venue.
This is true, but can only be done when rendering a map on the page. That is, Google’s terms of use forbid you from simply ‘hitch-hiking’ map requests just to reverse geo-code an address.Stephen HarrisJanuary 29, 2016 at 9:32 am #21020That’s really weird about the iCal date. On Google the event start and end times are both shown as a day + time.
I will ask the calendar owner to contact google and check if there’s a setting in Google Calendar that is responsible.Re Google Maps lookup
This is true, but can only be done when rendering a map on the page.
The map is rendered on the front end, as well as in the EO venue admin screen. For venues that are not added via the admin page (eg by feed) and don’t have a lat/long value passed, could loading the front end venue/event trigger the google lookup? eg using the address data in the first instance, and as a fallback use the venue title (in our instance, many iCal events have all the address data placed in the title of the venue, but this isn’t added to the address fields in the EO venue. Even when manually editing these venues in EO, the map doesn’t work until I copy and paste the full venue title, including the address, into the address 1 field. then the google geocoding does its thing and the map works fine. ) If this were implemented, it would presumably be a step before the change in our pull request (hiding the map when the venue has no lat/long co-oordinates). In other words, only hide the map when all attempts to get a lat/long value have failed.
Dan BradyFebruary 2, 2016 at 8:35 pm #21135If this were implemented, it would presumably be a step before the change in our pull request (hiding the map when the venue has no lat/long co-oordinates).
The problem here is that the Google map is loaded client side and the template rendered server-sided. That said there is a PHP based geocoder library: http://geocoder-php.org/.
This provides a number of potential providers who have a varying terms of use (this isn’t particularly well communicated). Using that library you could look up latitude/longitude co-ordinates at the point the venue is imported, in the template or as part of a regularly run cron-job. I’d be happy to help with any of these, but it won’t be possible to include this in the core plug-in because it doesn’t support php 5.2 (though you can implement any of those without having to edit the plug-in’s files). For parsing venues as they are imported you can use the hook detailed at the bottom of this page: http://docs.wp-event-organiser.com/importing-events/importing-events-from-an-ical-feed/.
Also on reflection, you are obtaining latitude/longitude co-ordinates for the sole purpose of displaying on Google maps – so I think you may well be permitted to pre-fetch this data.
Stephen Harris -
AuthorPosts