Hi sViz;
Good to see you! Long time...
OK to the code andentered the correct directy and file nam to the section you pointed at and the code is as fillows.
1.Dim xmlfile
2.xmlfile = object.Directory & "C:\Users\Automan\AppData\Local\Temp\Weather.2004\Weather.Forecast.37932.English.5.Days.xml" '--YOUR XML FILE HERE
3.'Called when the script is executed
4.Sub Object_OnScriptEnter
5. getcontent = readFile '--get xml contents
6. parsecontent = extractInfo(getcontent,"<to>","</to>"&vbcrlf) '--retrieve unwanted section
7. getcontent = replace(getcontent,parsecontent,"") '--erase unwanted section
8. writefile(getcontent)'--rewrite file
9.End Sub
10.
11.'Declare constants
12.Const ForReading = 1, ForWriting = 2, ForAppending = 8
13.'Declare the file system object
14.Dim fso, f, Msg
15.Set fso = CreateObject("Scripting.FileSystemObject")
16.Function readFile
17. 'Check if file exists
18. If fso.FileExists(xmlfile) Then
19. Set f = fso.OpenTextfile(xmlfile, ForReading)
20. fileinfo = f.readall
21. f.Close
22. Else
23. msgbox "File does not exist"
24. End If
25. readFile = fileinfo
26.End Function
27.Sub writeFile(newcontent)
28. 'Create a file and write some text
29. Set f = fso.OpenTextfile(xmlfile, ForWriting, True)
30. f.Write newcontent
31. 'Properly close file
32. f.Close
33.End Sub
34.Function extractInfo(info, startStr, endStr)
35. iStart = instr(1, info, startStr)
36. iEnd = instr(iStart, info, endStr)
37. iEnd = iEnd + Len(endStr) '--include closing tag
38. iLength = iEnd - iStart
39. info2 = mid(info, iStart, iLength)
40. extractInfo = info2
41.End Function
Now when I try to save and apply the code I get an immediate errow on line 1--->
Expected statement
Line: 1
Code:
1.Dim xmlfile
Thats it.
Question? Is there a way to get code for an XML weather formation like the picture I have and just use DESKtopX to retreve the Weather data to a directory os choice then strip the bad stuff " Advertizing ", then set where the 42x42 Weather Images are at. the layout all the fields the same as the Samurize config, and just drop Samurize altogether and have the weather running with in the DesktopX Theme I have.
Reason for using only desktopX for the Weather XML and images and info placeed into the same position as I have in the image is that I want the weather to be DesktopX run Weather altogether so that I can release this theme and get permissions and give credits, ets,
This Desktop is aone of a kind not produces or even close to all the DesktopX themes I have seen, this is a real life desktop that have running weather radar using two or three HTML page whice I will make available, with docs.
Take a look at this screen shot and you wisee what I mean:
https://www.wincustomize.com/skins.aspx?skinid=24755&libid=13
The Today Weather at the top I can get working, if i have a script to get going on the 5Day with. I just create two objects and place the weather script to them and presto they are all done withDesktopX and not using another program.
But I do think you are very close in you code to picking out the downloaded XML file and getting rid of the AD section. That wat if Weather.com changes again it's just a matter of stripping some more of the downloaded file again.
Thanks a Million, I willl try the code again after ya tell me what I probable did wrong on the script you wrote, just to pre check it.
Automan