It is currently March 28th, 2024, 10:09 pm

Problem with rss [YQLFeed]

Get help with creating, editing & fixing problems with skins
phoretis
Posts: 1
Joined: December 24th, 2013, 8:22 am

Problem with rss [YQLFeed]

Post by phoretis »

I have a problem with my rss feed in debug mode i have this message :
Script : YQLFeed.lua:53: field 'day' missing in date table

I use 10 clones of this script to display all my feeds may be it's here the problem ?

YQLFeed.lua :

Code: Select all

function Initialize()
	
	newMinutes = tonumber(SKIN:GetVariable('NewMinutes'))
	newColor = SKIN:GetVariable('NewEntryColor')
	oldColor = SKIN:GetVariable('OldEntryColor')
	
end

function Update()

end

function CheckNew(measureArg, meterArg, measureAgeArg)

	local timeMeasure = SKIN:GetMeasure(measureArg)
	local timeString = timeMeasure:GetStringValue()
	local timeDifference = os.time(os.date('!*t')) - TimeStamp(timeString)
	
	local timeDifferenceFormat = ConvertSeconds(timeDifference)
	if timeDifferenceFormat['mins'] == 1 then minText = "minute" else minText="minutes" end
	if timeDifferenceFormat['hours'] == 1 then	hourText = "hour" else hourText="hours" end
	if timeDifferenceFormat['days'] == 1 then dayText = "day" else dayText="days" end
	
	if timeDifference <= 86400 then
		if timeDifference < 3600 then
			ageDisplay = timeDifferenceFormat['mins']..' '..minText..' ago'
		else	
			ageDisplay = timeDifferenceFormat['hours']..' '..hourText..' '..timeDifferenceFormat['mins']..' '..minText..' ago'
		end	
	else
		ageDisplay = timeDifferenceFormat['days']..' '..dayText..' '..timeDifferenceFormat['hours']..' '..hourText..' '..timeDifferenceFormat['mins']..' '..minText..' ago'
	end

	SKIN:Bang('!SetOption', measureAgeArg, 'Format', ageDisplay)	
	
	if timeDifference / 60 <= newMinutes then
		SKIN:Bang('!SetOption', meterArg, 'FontColor', newColor)
	else
		SKIN:Bang('!SetOption', meterArg, 'FontColor', oldColor)
	end	

	SKIN:Bang('!UpdateMeter', '*')
	SKIN:Bang('!Redraw')

end

function TimeStamp(itemDate)

	-- Feed date format : 2013-12-07T01:23:32Z
	local year, month, day, hour, min, sec, zone =		
		string.match(itemDate, "(.-)-(.-)-(.-)T(.-):(.-):(.-)(.-)")
	
	return os.time({year=year, month=month, day=day, hour=hour, min=min, sec=sec, isdst=false})

end

function ConvertSeconds(secondsDiff)
    
	local daysDiff = (secondsDiff / 86400)
	local daysRemainder = (secondsDiff % 86400)
	local hoursDiff = (daysRemainder / 3600)
	local hoursRemainder = ((secondsDiff - 86400) % 3600)
	local minsDiff = (hoursRemainder / 60)
	
	local tConvertSeconds = {days = math.floor(daysDiff); hours = math.floor(hoursDiff); mins = math.floor(minsDiff)}	
	
	return tConvertSeconds
	
end
And the YQLFeed.ini :

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
@IncludeContext=#@#Context.inc

[Metadata]
Name=YQLFeed
Author=JSMorley
Information=Demonstration of using the YQL syntax to obtain feeds produced in any format || Feeds can be changed in @Resources\Feeds.inc
Version=Dec 13, 2013
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
NewMinutes=15
HeaderColor=435b6f
;NewEntryColor=246,232,177,255
NewEntryColor=a2b4a4
OldEntryColor=e4e4e4
EntryAgeColor=687e90
EntrySolidColor=30,30,30,255
EntryGradientColor=0,0,0,0

@IncludeDecoder=#@#Decoder.inc
@IncludeFeeds=#@#Feeds.inc
@IncludeURLEncoder=#@#URLEncoder.inc

FeedInfo=<title.*>(.*)</title>.*<link href="(.*)"
Entry=(?(?=.*<entry>).*<entry>(.*)</entry>)
EntryItem=<title.*>(.*)</title>.*<link href="(.*)".*<updated>(.*)</updated>

[MeasureFeed]
Measure=Plugin
Plugin=WebParser
URL=[&MeasureURLEncoder]
RegExp=(?siU)#FeedInfo##Entry##Entry##Entry##Entry##Entry#
ForceReload=1
UpdateRate=300
DynamicVariables=1
FinishAction=[!CommandMeasure MeasureNew """CheckNew("MeasureEntry1Time", "MeterEntry1Title", "MeasureEntry1Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry2Time", "MeterEntry2Title", "MeasureEntry2Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry3Time", "MeterEntry3Title", "MeasureEntry3Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry4Time", "MeterEntry4Title", "MeasureEntry4Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry5Time", "MeterEntry5Title", "MeasureEntry5Age")"""]

; Feed Information

[MeasureFeedTitle]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=1
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureFeedLink]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=2
Substitute=#Decoder#
DecodeCharacterReference=1

; Entry 1
[MeasureEntry1Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=3
RegExp=(?siU)#EntryItem#
StringIndex2=1
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry1Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=3
RegExp=(?siU)#EntryItem#
StringIndex2=2
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry1Time]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=3
RegExp=(?siU)#EntryItem#
StringIndex2=3

[MeasureEntry1Age]
Measure=Time
Format=" "

; Entry 2

[MeasureEntry2Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=4
RegExp=(?siU)#EntryItem#
StringIndex2=1
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry2Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=4
RegExp=(?siU)#EntryItem#
StringIndex2=2
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry2Time]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=4
RegExp=(?siU)#EntryItem#
StringIndex2=3

[MeasureEntry2Age]
Measure=Time
Format=" "

; Entry 3

[MeasureEntry3Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=5
RegExp=(?siU)#EntryItem#
StringIndex2=1
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry3Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=5
RegExp=(?siU)#EntryItem#
StringIndex2=2
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry3Time]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=5
RegExp=(?siU)#EntryItem#
StringIndex2=3

[MeasureEntry3Age]
Measure=Time
Format=" "

; Entry 4

[MeasureEntry4Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=6
RegExp=(?siU)#EntryItem#
StringIndex2=1
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry4Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=6
RegExp=(?siU)#EntryItem#
StringIndex2=2
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry4Time]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=6
RegExp=(?siU)#EntryItem#
StringIndex2=3

[MeasureEntry4Age]
Measure=Time
Format=" "

; Entry 5

[MeasureEntry5Title]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=7
RegExp=(?siU)#EntryItem#
StringIndex2=1
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry5Link]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=7
RegExp=(?siU)#EntryItem#
StringIndex2=2
Substitute=#Decoder#
DecodeCharacterReference=1

[MeasureEntry5Time]
Measure=Plugin
Plugin=WebParser
URL=[MeasureFeed]
StringIndex=7
RegExp=(?siU)#EntryItem#
StringIndex2=3

[MeasureEntry5Age]
Measure=Time
Format=" "

; Check entry ages

[MeasureNew]
Measure=Script
ScriptFile=#@#YQLFeed.lua
UpdateDivider=-1

[MeasureEntryAges]
Measure=Time
Format=%M
OnChangeAction=[!CommandMeasure MeasureNew """CheckNew("MeasureEntry1Time", "MeterEntry1Title", "MeasureEntry1Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry2Time", "MeterEntry2Title", "MeasureEntry2Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry3Time", "MeterEntry3Title", "MeasureEntry3Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry4Time", "MeterEntry4Title", "MeasureEntry4Age")"""][!CommandMeasure MeasureNew """CheckNew("MeasureEntry5Time", "MeterEntry5Title", "MeasureEntry5Age")"""]

; Meters

[MeterBackground]
Meter=Image
W=300
H=([MeterEntry1Title:H]+[MeterEntry2Title:H]+[MeterEntry3Title:H]+[MeterEntry4Title:H]+[MeterEntry5Title:H]+58)
ImagePath=#@#Images\
ImageName=Background.png
ImageTint=#HeaderColor#
;ScaleMargins=3,3,3,3
DynamicVariables=1

[MeterHeadBackground]
Meter=Image
X=2
Y=2
W=296
H=40
;SolidColor=10,10,10,255

[MeterHeadBar]
;Meter=Image
;X=8
;Y=21
;W=282
;H=5
;SolidColor=10,10,10,255
;SolidColor2=#HeaderColor#

[MeterFeedTitle]
Meter=String
X=8
Y=18
FontFace=Segoe UI
FontSize=10
FontColor=#HeaderColor#
StringStyle=Bold
AntiAlias=1
Text=#CurrentFeedTitle#
LeftMouseUpAction=["[MeasureFeedLink]"]

[MeterEntry1Title]
Meter=String
MeasureName=MeasureEntry1Title
X=3
Y=40
W=287
FontFace=Segoe UI
FontSize=8
;SolidColor=#EntrySolidColor#
SolidColor2=#EntryGradientColor#
Padding=4,0,4,23
AntiAlias=1
ClipString=2
DynamicVariables=1
LeftMouseUpAction=["[MeasureEntry1Link]"]

[MeterEntry1Age]
Meter=String
MeasureName=MeasureEntry1Age
X=8
Y=-19R
W=287
H=20
FontSize=7
FontColor=#EntryAgeColor#
AntiAlias=1

[MeterEntry2Title]
Meter=String
MeasureName=MeasureEntry2Title
X=3
Y=-5R
W=287
FontFace=Segoe UI
FontSize=8
;SolidColor=#EntrySolidColor#
SolidColor2=#EntryGradientColor#
Padding=4,0,4,23
AntiAlias=1
ClipString=2
DynamicVariables=1
LeftMouseUpAction=["[MeasureEntry2Link]"]

[MeterEntry2Age]
Meter=String
MeasureName=MeasureEntry2Age
X=8
Y=-19R
W=287
H=20
FontSize=7
FontColor=#EntryAgeColor#
AntiAlias=1

[MeterEntry3Title]
Meter=String
MeasureName=MeasureEntry3Title
X=3
Y=-5R
W=287
FontFace=Segoe UI
FontSize=8
;SolidColor=#EntrySolidColor#
SolidColor2=#EntryGradientColor#
Padding=4,0,4,23
AntiAlias=1
ClipString=2
DynamicVariables=1
LeftMouseUpAction=["[MeasureEntry3Link]"]

[MeterEntry3Age]
Meter=String
MeasureName=MeasureEntry3Age
X=8
Y=-19R
W=287
H=20
FontSize=7
FontColor=#EntryAgeColor#
AntiAlias=1

[MeterEntry4Title]
Meter=String
MeasureName=MeasureEntry4Title
X=3
Y=-5R
W=287
FontFace=Segoe UI
FontSize=8
;SolidColor=#EntrySolidColor#
SolidColor2=#EntryGradientColor#
Padding=4,0,4,23
AntiAlias=1
ClipString=2
DynamicVariables=1
LeftMouseUpAction=["[MeasureEntry4Link]"]

[MeterEntry4Age]
Meter=String
MeasureName=MeasureEntry4Age
X=8
Y=-19R
W=287
H=20
FontSize=7
FontColor=#EntryAgeColor#
AntiAlias=1

[MeterEntry5Title]
Meter=String
MeasureName=MeasureEntry5Title
X=3
Y=-5R
W=287
FontFace=Segoe UI
FontSize=8
;SolidColor=#EntrySolidColor#
SolidColor2=#EntryGradientColor#
Padding=4,0,4,23
AntiAlias=1
ClipString=2
DynamicVariables=1
LeftMouseUpAction=["[MeasureEntry5Link]"]

[MeterEntry5Age]
Meter=String
MeasureName=MeasureEntry5Age
X=8
Y=-19R
W=287
H=20
FontSize=7
FontColor=#EntryAgeColor#
AntiAlias=1

May be someone could solve this error ?
Thanks for your help