It is currently April 26th, 2024, 11:48 pm

Google Calendar support

General topics related to Rainmeter.
mrf
Posts: 2
Joined: September 14th, 2015, 6:50 pm

Google Calendar support

Post by mrf »

So, looking through various threads - still no valid way to have Google Cal support after API v3?
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Google Calendar support

Post by moshi »

works just fine.
(if you consider writing your own regular expressions a "valid way" ;) )

maybe one day i'll upload that skin again, but certainly not soon.
Untitled-1.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Google Calendar support

Post by jsmorley »

moshi wrote:works just fine.
(if you consider writing your own regular expressions a "valid way" ;) )

maybe one day i'll upload that skin again, but certainly not soon.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeterLine]
Meter=Image
W=5
H=300
SolidColor=173,255,173,255

[MeterAspergers]
Meter=String
X=10
Y=5
FontSize=11
FontColor=255,255,255,255
SolidColor=14,87,14,255
Padding=5,5,5,5
AntiAlias=1
Text=Asperger's Syndrome

[MeterMoshi]
Meter=String
X=10
Y=60
FontSize=11
FontColor=255,255,255,255
SolidColor=14,87,14,255
Padding=5,5,5,5
AntiAlias=1
Text=Moshi

[MeterWilliams]
Meter=String
X=10
Y=270
FontSize=11
FontColor=255,255,255,255
SolidColor=14,87,14,255
Padding=5,5,5,5
AntiAlias=1
Text=Williams–Beuren Syndrome
1.jpg
:-)
You do not have the required permissions to view the files attached to this post.
MikeG621
Posts: 87
Joined: March 18th, 2013, 1:59 pm

Re: Google Calendar support

Post by MikeG621 »

My dynamically tabbed Gcal skin is working fine, too, derived from the Enigma skin. It's part of my suite, but I've extracted out the important bits

Code bits below:
This is *not* the full code, but should have most of the information to point you in the right direction.

Skin bits:

Code: Select all

[Variables]
Cal1=***
Cal2=https://www.google.com/calendar/feeds/en.usa%23holiday%40group.v.calendar.google.com/public/basic
WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE>":"","PRE>":"","&nbsp;":" ","&":"&","'":"'"

[MeasureFeed2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=216000
Url=#Cal2#?max-results=4&futureevents=true&singleevents=true&orderby=starttime&sortorder=a
RegExp=(?siU)(.*)$
DecodeCharacterReference=1
Substitute=#WebParserSubstitute#
FinishAction=!CommandMeasure MeasureReader Update()

[MeasureReader]
Measure=Script
ScriptFile="#@#Scripts\Reader.lua"
Disabled=1
MultipleFeeds=1
MinItems=4
Lua bits:

Code: Select all

function ParseSpecialCharacters(sString)
	sString = string.gsub(sString, '&nbsp;', ' ')
	sString = string.gsub(sString, '\"', '\'\'')
	sString = string.gsub(sString, '"', '\'\'')
	return sString
end

function Update()
	local measure = SKIN:GetMeasure('MeasureFeed2')
	local raw = measure:GetStringValue()
	local feedLinkPattern = '.-<link.-rel=.-alternate.-href=\'(.-)\''
	local itemLinkPattern = '.-<link.-href=\'(.-)\''
	local itemDatePattern = '.-When: (.-)<'
	feedTitle, feedLink = string.match(raw, '.-<title.->(.-)</title>'..feedLinkPattern)
	feedTitle = ParseSpecialCharacters(feedTitle)
	feedLink = ParseSpecialCharacters(feedLink)
	local initIndex = 0
	local startIndex = 0
	local endIndex = 0
	local item = ''
	local titles = {}
	local links = {}
	local dates = {}
	for i = 1, numberOfItems do
		startIndex, endIndex = string.find(raw, itemPattern, initIndex)
		item = string.sub(raw, startIndex, endIndex)
		titles[i] = string.match(item, '.-<title.->(.-)</title>')
		titles[i] = ParseSpecialCharacters(titles[i])
		links[i] = string.match(item, itemLinkPattern)
		links[i] = ParseSpecialCharacters(links[i])
		if string.match(item, itemDatePattern) then
			dates[i] = string.match(item, itemDatePattern)
			dates[i] = ParseSpecialCharacters(dates[i])
			-- removal of second date created by GMT rollover
			local dateEnd = string.find(dates[i], ",") + 5
			local eventDate = " " .. string.sub(dates[i], 1, dateEnd)
			dates[i] = string.gsub(dates[i], eventDate, "")
			-- local date replacement for "Today" if applicable
			local today = os.date("%a %b %d, %Y")
			today = string.gsub(today, " 0(%d,)", " %1")
			dates[i] = string.gsub(dates[i], today, "Today")
		else
			dates[i] = ''
		end
		initIndex = endIndex + 1
	end
end
You do not have the required permissions to view the files attached to this post.
MikeG621
Posts: 87
Joined: March 18th, 2013, 1:59 pm

Re: Google Calendar support

Post by MikeG621 »

Per an email received ~15 minutes ago:
Because of low usage, and in an effort to streamline our services, from 18 November 2015, XML feeds will no longer be available in Google Calendar. You're getting this message because you're currently viewing or sharing a link to one or more of your calendars using an XML feed.

We apologise for any inconvenience caused. Google Calendar will continue to support three ways of viewing your calendars in other applications or on websites. You can:

* Access your calendar in other applications, such as Microsoft Outlook or Apple Calendar, using iCal.
* Embed your calendar in your website or blog using HTML.
* Use the Google Calendar API to display, create and modify calendar events if you're a developer.
So this is going to break a *lot* of skins...
User avatar
LittleOne
Posts: 48
Joined: March 24th, 2015, 4:03 am

Re: Google Calendar support

Post by LittleOne »

its already break a lot of skin O.O
if there is a way to sort the output of ics generated by google calendar it will be Great!