New Localist platform has been sucessfully servicing Stanford Events. It has some features that are very well documented and some hidden gems.
One of the hidden gems is communication channel at Stanford Slack https://stanford-ssla.slack.com/archives/C02QDP5SQ68
Another hidden gem is JSON feed for events described in detail here: https://developer.localist.com/doc/api
If you are looking for a feed from only one organization you have an option to use localist ID for this organization/group. It is important to know that you should use group_id not departement or department_id in the url.
For example,
- You can get events for 30 days for a particular department events.stanford.edu/api/2/events?days=30&group_id=38563138319388
- You can request start and end dates https://events.stanford.edu/api/2/events?start=2023-01-23&end=2023-04-24&group_id=38563138319388&pp=90
- Pagination is limited to 100 events per page, so you need to use pp for number of posts per page and p for number of the page if you need to get more than 100 events.
- Photo information requires additional API call to photo object https://events.stanford.edu/api/2/photos/44015381299530
You can find very detailed guide here https://events-help.stanford.edu/ .
Mapping for Events fields
Creating events importer for D9/10 site step by step
- Install the following modules: Feeds, Feeds Tamper and Feeds Extensible Parsers https://www.drupal.org/project/feeds_ex
-
Create new Feed type for Node Content type Event
-
Set context using this documentation https://www.drupal.org/docs/contributed-modules/feeds-extensible-parsers/setting-context-for-extendable-feeds#s-json-context-example
- Map fields (similar to mapping for D7 )
- Create feed with url from localist, for example https://events.stanford.edu/api/2/events for all events, or for 30 days of events with organization ID '38563138319388' https://events.stanford.edu/api/2/events?days=30&group_id=38563138319388
- Import events
Examples:
filter by
venue_id: Frost (37519080086796)
https://events.stanford.edu/api/2/events?venue_id=37519080086796&days=365&pp=100
filter by
venue_id: Frost (37519080086796)
event_subject: Business (37952873721356)
event_types: Exhibition (37952570030426)
https://events.stanford.edu/api/2/events?venue_id=37519080086796&type%5B0%5D=37006980810291&match=any&days=365&pp=100
https://events.stanford.edu/api/2/events?venue_id=37519080086796&type%5B0%5D=37952873721356&type%5B1%5D=37952570030426&match=any&days=365&pp=100
direct by event_id:
https://events.stanford.edu/api/2/events/44475127680618
by group id: (38944608761674 = Corporations and Society Initiative (CASI))
https://events.stanford.edu/api/2/events?group_id=38944608761674&days=365&pp=100
get list of groups
https://events.stanford.edu/api/2/groups
get list of departments:
https://events.stanford.edu/api/2/departments
https://events.stanford.edu/api/2/departments?page=2
get list of filters (event_audience, event_types, event_subject)
https://events.stanford.edu/api/2/events/filters