I wouldn't use WebParser at all in this case... You have a local file, and you want to read it and detect strings in it on a line by line basis. It will be a lot easier and MUCH more powerful and flexible if we do it in Lua.
Test.txt:
Code: Select all
2011-01-27 repair kelisa water part ?25/02/2011 @errand
2011-03-08 buy printer @shop
2011-03-09 buy scanjet @shop
2011-04-07 list down rmtr alarm criteria +rmtr
2011-04-10 surf n search how to create android +apk
2011-04-16 buy treadwalk @shop
2011-04-22 buy genographic kit @shop
2011-05-04 update resume @computer
2011-05-07 saline nose @home
2011-05-07 send painting for frame @anywhere
2011-05-12 read menon chapter1 @home
2011-05-22 recode vbs to identify allergic @computer +allergic
2011-05-26 recode inbox to add location +inbox
Test.ini:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[MeasureScript]
Measure=Script
ScriptFile=#CURRENTPATH#Test.lua
FileName=#CURRENTPATH#Test.txt
ToDoType=@shop
UpdateDivider=-1
[TextStyle]
X=0
Y=2R
FontFace=Arial
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
[MeterHeader]
Meter=String
MeterStyle=TextStyle
X=0
Y=1
H=18
W=235
SolidColor=0,0,0,255
Text=Enter Search
LeftMouseUpAction=!CommandMeasure "MeasureInput" "ExecuteBatch 1"
[MeasureInput]
Measure=Plugin
Plugin=InputText.dll
X=0
Y=0
H=18
W=235
FontFace=Arial
FontSize=11
FontColor=255,255,255,255
SolidColor=0,0,0,255
Command1=!Execute [!SetOption MeasureScript ToDoType "$UserInput$][!UpdateMeasure MeasureScript #CURRENTCONFIG#]
[Meter1]
Meter=String
MeterStyle=TextStyle
Y=5R
[Meter2]
Meter=String
MeterStyle=TextStyle
[Meter3]
Meter=String
MeterStyle=TextStyle
[Meter4]
Meter=String
MeterStyle=TextStyle
[Meter5]
Meter=String
MeterStyle=TextStyle
Test.Lua:
Code: Select all
function Initialize()
sFileName = SELF:GetOption('FileName')
end -->Initialize
function Update()
for i = 1, 5 do
SKIN:Bang('!SetOption Meter'..i..' Text \"\"')
end
hFile = io.open(sFileName)
if not hFile then print('File error'); return 'File error'; end
io.close(hFile)
sToDoType = SELF:GetOption('ToDoType')
if sToDoType == '' then SKIN:Bang('!Refresh'); return 'No input'; end
tData = {}
for sLine in io.lines(sFileName) do
if string.find(sLine, sToDoType) then
table.insert(tData, sLine)
end
end
for i = 1, (#tData < 6) and #tData or 5 do
SKIN:Bang('!SetOption Meter'..i..' Text \"'..tData[i]..'\"')
end
return (#tData)
end -->Update
This is a bit quick and rough, but what I have set up is an InputText measure that takes any search string you want. It can be stuff like @shop or @computer if you want, but really can be any string that is contained in the file. You could just as easily enter "2011-03' and it would list everything dated March of last year...
Then that input is passed dynamically as a setting to a Lua Script measure that is then triggered.
The Lua script reads in that Test.txt file, and for any line where your search criteria is found (up to 5, but you can add more meters to the skin .ini and make it as many as you want) it will populate the "Text" setting of a meter to display it.
Feel free to take a look at this, and please, ask any questions about anything you don't get. It's really not hard stuff at all, and once you wrap your head around what it is doing, you can play with it to do all kinds of spiffy things as desired.
3-26-2012 3-13-14 AM.jpg
P.S. I have it defaulting to showing all "@shop" entries, and if in fact that is really all you want (and I'm betting it isn't) you can remove the [MeterHeader] and [MeasureInput] sections completely and it will do exactly what you originally asked. Just show all lines with @shop on them.
You do not have the required permissions to view the files attached to this post.