Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-11-14 20:56:48

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Google Calendar Plugin for TXP [VIDEO]

Hi! I am looking for TXP developers and community members who might be interested in a plugin that will allow users to add and edit Google Calendar events from within the TXP back end via the Google Calendar API.

Please view my video for a more descriptive visual/verbal explanation of my plugin request:
https://www.youtube.com/watch?v=pqo3uLQTnmw

Thanks for any feedback anyone would like to offer! :)

Offline

#2 2014-11-15 06:27:19

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Google Calendar Plugin for TXP [VIDEO]

A slight tangent: Google is shutting down versions 1 & 2 of its Calendar API on Monday 17th November.

So, any development must be done using API v3. This uses OAuth & it makes my head hurt just thinking about it. I hope you find an expert to fulfil your dreams – they look great.

Like you, I’m also retrieving Calendar data from Google – in my case using the “full” read-only XML feed (but with a backup plan to use the “basic” feed). It’s a clear as mud as to whether the full read-only feed will survive past Monday. One could argue that it’s part of v2 API, so I’m not particularly hopeful. The basic feed is what the world uses to subscribe to a Google Calendar (e.g. from iCal etc), so I’d be dumfounded if they kill that as well. Time will tell.

Offline

#3 2014-11-17 21:05:29

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Google Calendar Plugin for TXP [VIDEO]

The Google Deprecator has struck – the full XML calendar feed is dead … wait for the sound of screaming!

I’m off to implement Plan B(asic) before the client notices …

Offline

#4 2014-11-18 04:26:03

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: Google Calendar Plugin for TXP [VIDEO]

Hi Adi, Thanks for your response to my post. I hope you are having luck with Plan B. I’m using Google’s API v3 for the calendar example in the video above. I’m not sure if my method is the best route to take, but it has been workding for me. I’m sure someone with more programming knowledge could do this more efficiently. My method uses yahoo pipes to parse Google’s JSON feed. I went this route because I wanted to combine multiple google calendar feeds into one. Here’s my attempt at a quick tutorial for listing calendar events via API v3:

Create a rah_eo_yourformname.xml with the following: http://pastebin.com/41PyPqf2
(note: you have to paste your API Key in there. It isn’t super secure because it will be visible if/when the rah_eo form is viewed online. So, don’t share the address of this file with anyone. Also, you can manipulate the timeMax and timeMin to adjust the time period for events.

Then, go to Yahoo Pipes and clone the source of my pipe here (click on Edit Source and then Save a Copy):
https://pipes.yahoo.com/pipes/pipe.info?_id=8df8f5e42ee9f5f6aae31635b8422ad6

In the pipe source, edit the Fetch Feed URL to the correct url to your rah_eo xml form output:
http://yourwebsite.com/?rah_external_output=yourformname.xml
Note: make sure you don’t publish your yahoo pipe to the public or the xml file with your API Key will be discoverable.

Then, this is an example of code that you can use in your TXP page template to show a simple list of your upcoming events:
http://pastebin.com/KVUB2Vqw
(put the url to your Yahoo Pipe JSON feed in line 4 of this example. Note that if your site is in Debugging mode, there will be a php error before any event without a location specified. I haven’t figured out how to get rid of this error. It does not show up when the site is in Testing or Live mode.)

Required TXP Plugins:
rah_eo
smd_if
aks_cache
etc_date

Note: The above txp template code will display one calendar. The video in my original post above shows several google calendars merged into one via Yahoo Pipes. Each google calendar id, calendar title, and calendar color comes from fields in textpattern articles in the resources section of the site. The rah_eo xml form contains an article_custom tag around each <item> block to display calendar data for all the articles with calendar ids. The yahoo pipe works for this setup as well – in fact, it’s really geared toward reading the multiple callender list in the xml document.

Calendario.js the plugin used to display the full calendar:
http://tympanus.net/codrops/2012/11/27/calendario-a-flexible-calendar-plugin/

This rah_eo_yourformname.js form provides the data that Calendario uses to display the events:
http://pastebin.com/8KHCMwst
(Note ALL CAPS for your info)

The above txp template form requires these additional TXP plugins:
etc_query
smd_wrap
sho_urlencode

Let me know if you have any questions!

Last edited by photonomad (2014-11-18 07:57:10)

Offline

#5 2014-11-18 09:01:08

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Google Calendar Plugin for TXP [VIDEO]

Yep, my “contingency plan I prepared earlier” worked thanks and I think I got away it, without anyone noticing.

Very impressed with your raft of interworking plugins. Makes my single TXP plugin look positively unsophisticated! Which it is. Anyway, it’s good enough for doing simple lists of upcoming events and there’s no messing around with authentication. Strictly read-only though.

Our counterparts in WordPress-land have noticed something’s amiss.

Offline

#6 2014-11-18 09:50:42

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,260
GitHub

Re: Google Calendar Plugin for TXP [VIDEO]

A propos nothing: didgoogleshutdown.com

Offline

Board footer

Powered by FluxBB