Hey;
Hope everyone is doing great!!!
I posted a link to an image of my 5 Day forcast and the way it's layout is. Image Below:
Hey RomanDA ; I there guy we have typed in the past a lot on mods for Desktopx. Where you at on this one buddy?
I want to use the Weather XML but I don't or haven't had the time to look into all of the weather widgets for DesktopX and also the Objects for Forcasting in DesktopX.
I am trying to make my DesktopX Weather come out the same as i the screenshot link and can't seem to get the images to show or get it with in the same layout.
I always keep it on and it checks the weather XML every 30 mins. I am using Samurize to don this as the program had a Weather 2004.dll that makes it wasy to set-Up the 5Day forcast.
So can some one give me some help on the switch to DesktopX. When the Prometheus Dark DesktopX Pro Theme comes out I will give all of the weather related accomplishment CREDITS to who ever might help on this.
I hope some one can help as I don't want to pick someone elses weather Object or Widget apart and make it work with this theme.
Thanks
Automan
i believe there are a few weather widgets over in the widgets forum, and if you take some time and look them over you should be able to see how they work, or do like most people do, and take one and just move the images around, and put some new text on them.
Hi RomanDA;
I am trying to get help on building a weaher 5Day that will pull the XML file and save it to a Directory like my temp dir., then there is a section of the XML file that is advertizing from Weather.com, this XML area screws up the XML file so I have to get this build to either strip the section out of the XML file then read it after the fix.
I can look at the 5Day section of one of the widgets but the XML problem is still there.
Now if the reading of the XML file will over look the Advertizing section and pull the 1st dat Now and Later then it's a go.
I just can't seem to be able to get around the section I am refering to.
Any ideas on that?
that there guy for the reply, I would like to quit using the Samurize program all together and just use DesktopX for all of my weather.
Also take a look at my next post, there is something wrong with using the Internet ActiveX control thats with DesktopX that is showing a Border on the Right and Bottom of the Web Control item. I called Microsoft and they mentioned that DesktopX needs to be changed to handle this. So I am going to leave a message for the Support team to get them to take a look at this.
What XML file are you using? Where from? I think you should be able to parse out the unwanted info and then rewrite the file.
This is just a quickie file parser code. It'll retrieve the unwanted section, erase it, and rewrite the file.
Just put in your file path and section tags. You might want to test this on another xml file first, before you rewrite your actual xml file...just to see if it works.
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 xmlfile2.xmlfile = object.Directory & "C:\Users\Automan\AppData\Local\Temp\Weather.2004\Weather.Forecast.37932.English.5.Days.xml" '--YOUR XML FILE HERE3.'Called when the script is executed4.Sub Object_OnScriptEnter5. getcontent = readFile '--get xml contents6. parsecontent = extractInfo(getcontent,"<to>","</to>"&vbcrlf) '--retrieve unwanted section7. getcontent = replace(getcontent,parsecontent,"") '--erase unwanted section8. writefile(getcontent)'--rewrite file9.End Sub10.11.'Declare constants12.Const ForReading = 1, ForWriting = 2, ForAppending = 813.'Declare the file system object14.Dim fso, f, Msg15.Set fso = CreateObject("Scripting.FileSystemObject")16.Function readFile17. 'Check if file exists18. If fso.FileExists(xmlfile) Then19. Set f = fso.OpenTextfile(xmlfile, ForReading)20. fileinfo = f.readall21. f.Close22. Else23. msgbox "File does not exist"24. End If25. readFile = fileinfo26.End Function27.Sub writeFile(newcontent)28. 'Create a file and write some text29. Set f = fso.OpenTextfile(xmlfile, ForWriting, True)30. f.Write newcontent31. 'Properly close file32. f.Close33.End Sub34.Function extractInfo(info, startStr, endStr)35. iStart = instr(1, info, startStr)36. iEnd = instr(iStart, info, endStr)37. iEnd = iEnd + Len(endStr) '--include closing tag38. iLength = iEnd - iStart39. info2 = mid(info, iStart, iLength)40. extractInfo = info241.End Function
Now when I try to save and apply the code I get an immediate errow on line 1--->
Expected statementLine: 1Code: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.
You have to take out the numbers (1. 2. 3. etc) that get copied with the script. Don't know why the forums copy numbers with the script; kinda defeats the purpose.
Don't forget to change the XML tags in this line to the ones you're stripping out:
parsecontent = extractInfo(getcontent,"<to>","</to>"&vbcrlf) '--retrieve unwanted section
Here's the code again without those numbers:
Dim xmlfilexmlfile = object.Directory & "hi.xml" '--YOUR XML FILE HERE
'Called when the script is executedSub Object_OnScriptEnter getcontent = readFile '--get xml contents parsecontent = extractInfo(getcontent,"<to>","</to>"&vbcrlf) '--retrieve unwanted section getcontent = replace(getcontent,parsecontent,"") '--erase unwanted section writefile(getcontent)'--rewrite fileEnd Sub
'Declare constantsConst ForReading = 1, ForWriting = 2, ForAppending = 8'Declare the file system objectDim fso, f, MsgSet fso = CreateObject("Scripting.FileSystemObject")
Function readFile 'Check if file exists If fso.FileExists(xmlfile) Then Set f = fso.OpenTextfile(xmlfile, ForReading) fileinfo = f.readall f.Close Else msgbox "File does not exist" End If readFile = fileinfoEnd Function
Sub writeFile(newcontent) 'Create a file and write some text Set f = fso.OpenTextfile(xmlfile, ForWriting, True) f.Write newcontent 'Properly close file f.CloseEnd Sub
Function extractInfo(info, startStr, endStr) iStart = instr(1, info, startStr) iEnd = instr(iStart, info, endStr) iEnd = iEnd + Len(endStr) '--include closing tag iLength = iEnd - iStart info2 = mid(info, iStart, iLength) extractInfo = info2End Function
I'm inclined to say yes. If all the information present in the screenshot above is retreived from an XML file, you should be able to strip out the info you need and apply them to text objects or image objects. But without seeing the actual XML file you're using, I can only postulate on how to do that. If you can send or point me to an example XML file like the one you're using I might be able to tailor the code.
Here is the tutorial I read to get started on making rss readers -- LINK
OK Tried the new code and get an error with DesktopX " Line 7 ) needed"?
Here is the XML file I use:
This document is intended only for use by authorized licensees of The
Weather Channel. Unauthorized use is prohibited. Copyright 1995-2009,
The Weather Channel Interactive, Inc. All Rights Reserved.
is it just me, or does the scare other people too?
Uh, yeah. I don't see this kind of xml file anywhere for public download on weather.com. Automan, are you sure you're allowed to use this?
Hithere again:
I signed up for the Weather.com XML and lave a license code and aut. code.
I pull today.XML and I pull 5 Day..
No prob folks, it is best to get a free license from them justlook on their site for tools and on the left of the list on down a ways the is the Weather.com XLM feed sign up "FREE"
This is mine with license:
<?xml version="1.0" encoding="ISO-8859-1" ?>
Hey Folks:
Thought that I would give you the link for the Weather.com XML FREE Feed after you sign up and remember FREE, Then down load the SDK. Forget some of the stuff like placing the Weather.cm Logo with your projects...All of the folks out there that use the XML Feed should at least sign-up......Only right....
Link: http://www.weather.com/weather/rss/subscription?from=footer
Have fun.
I posted what ya need to feel safe using this and yes it it theirs, but you just sign up and ya have your on License and code. You woun't beleive the Weather Info you can get.
If you take a look at the post above a ways I have a link to my desktopX Theme.
Now here is the kick! Look at the middle top of the screen at the Today Weather and zero in on the Wind Direction and on the left of it the Brometer.
If someone can help me I can give all the in for and you woun't beleiv the widget you could build.
1. The XML file has to be downloaded every 30 minutes and not sooner.
2. You even then have mapping for raday and the best part WEATHER WARNINGS, whice a guy writting this for desktopX could use an all clea png and an animated warning right on your desktop when you are goiing to get slammed with bad weather.
3. It's all there for the taking, anyone in the ourld.....
We need to build code for this weather to hit all of the above, and then you have a REAL Weather Widget...Not just the Today and 5 Day forcast.
I always try to make it real and I sure would like to build allof what I have done in another program right into DesktopX with the person giving me the right to distribute the theme and to also give that person credit.
That should get some of those neurons jumping!!!
Take Care bud!!
Ah, ok.
Line 7 of the code looks like this:
parsecontent = extractInfo(getcontent,"<to>","</to>"&vbcrlf)
Yours should look like this:
parsecontent = extractInfo(getcontent,"<lnks type=","</lnks>"&vbcrlf)
Leave out the "prmo"> because that will cause the error you're referring to.
This should remove the ad section and rewrite the file without it.
Thanks for the shot, but I get a can't find file error now?
Any idea why that one happened?
I might have gotten lost the other post mentioned do a re-write of the section?
I took and copied the one you had as an example and pasted it over the same section iin the script I have for testing?
What exactly did the error say? (copy & paste it here)
If it can't find the xml file then your xml file has been moved or otherwise gone missing. While testing, I usually use a spare xml file that I place on my desktop. That way I can easily check the file frequently to see if the operation worked, or if something went wrong. Make sure to check your xml file after each application of the script to see if the operation has already been successfully executed.
The error that comes up first is if you click the object you get this:
1. Normal Message box with OK button= The File Does not exist
Right after you hit OK button for the message bow error yu get a normal error from DesktopX with this:
Invalid procedure call or argument: 'instr'Line: 42Code:(not available)
That all it does and I have checked the path,etc.
Hi Again sViz:
Is there a possibility of pulling the information that is needed for the 5Day for cast and placing all of the images for the link to the weather icon number in like C:\localWeather\
Then just pull the fields and link the icon for that day to the images in the directory mentioned above, and just build this in DesktopX Pro to use DesktopX for the 5Day forcast.
I have shown that it is only illegal to use the XML download file if you have now signed up for it. I have and I can include instructions above in a post for all to see how to join and really be legal.
I sure would like to drop the other program and download the XML file to the Directory above But add a directory called XML and place the XML file into it every 35 minutes by a timer.
The way all of the other weather widgets get the weather may be the reason Weather.com gets pi***d?
Just a thought.
I only design with Photoshop CS4 and I am also an Engineer so I am just coming up with ideas on how this might work.
By the way " RomanDA ", I hope I have answered your concerns on how to get the real XML File from Weather.com.
There is also a great chance here to actually build a widget or object that has the borometer reading using a red arrow and also wind direction using a little math as to where the pointer should be compared to the info in the XML file and having this run real time.
I say COOL! Actually this would be one of the best 2 DesktopX weather systems built to date.
Thanks for the eye folks, I appreciate it.
Its fine.. i was just worred when i saw that. I have not played with weather xmls in forever, and i knew they were "cracking down" on people using the feeds.
I was just going over Martin's Base Weather widget, and realized your attempting the exact same thing--same website, same xml file, except without the advertisment.
I'd suggest downloading that and tailoring the script so it displays the information you want. He's also done a wind and UV meter (see above link.)
Hi sViz and hello RomanDA!!!
OK I looked at the Weather script and sure enough I can place my download code into it and it gets the weather, but remember that I may have mentioned that I use a directory for the 42 pixel specially made for weather 5Day ad need to access those png files also if I use the script for the Todat weather that is in the Desktop image gallery I will also have to have a way to get to my 85 Pixel png files fopr the weather Icon.
This is why I am really wanting to take and re-write those scripts for all of this and then I can use the info I need and use my own png's for the weather and they would be located is "C:\Weather" Everything need to go either there or a directory in the themes folder in the DesktopX folder.
Either way, there is a real need to be able to use my on path to different Icons. I also noticed the some of the Select section has severa Icons listed if a certain condition exist, I can fix that by adding all of the crrect "Selects".
There are some really great Images "PNG's", out there that look 100% better than the ones in the script.
Any ideas, I do hate to be so picky about this but there is a need to up date a 2004 Weather script to make it work for every one in any fasion that they want.
Thanks folks, I really appreciate your help on this.
is there a reason you use a directory, and not multiple "states" in the objects?
I always used 1 weather object with multiple states to it.
If you want to use a folder, you can always use desktopx.ExecutableDirectory to tell you where you loaded the exe from, and then use a folder under that, etc.
jsut my 0.02
Whoo Hi RomanDA;
Yes the way the weather is set up not I have Photoshop Icons of weather in 2 sizes and in a Directory called " WeatherIcons84 " for the Today Weather with all the bells a whistles like the Barometer gauge,ets and " WeathereIcons42 " for the 5Day weather touches up in Photoshop. I am currently working on enhancing the PNG's so that they are animated, but it's taking a while, but they are cool when you see rain and lightning thats actually moving in animation. That brings me to a good question I have. The AniUtil that comes with DesktopX can't handle some of the files I save to an Animation directory and produce the correctly. Do you know of a program that will do this, I have Photoshop CS4 and thought the Animation section in it would do it but they don't work in DesktopX right after you set them to be animated.
Also the reason for the image directories, is so that I can keep every thing concerning the weather seperated from the Theme directory so that if I want a new set of Icons that are better, I just download then and Automan the sizing in Photoshop.
Please help me build this, and all the ccredit goes to you and sViz if he get into the heat of the scripting.
1. All I need to do this isone object " layer " and place the selected infor onto it.
2. Asection in the script that has the legal copy"mine" other folks can sign up and finally be legal. Stardock doesn't evn know I don't think that all of the XML weather Widgets are illegal with out the user signing up and using the SDK you download from Weather.com?
I will be building two weather objects "Today Weather" and 5Day Weather" If one is build I can use it to make the other.
This widget will be one of the COOLEST out there, and if I accomplish this, You and sViz "onboard" can submit them as I will give you the codes and Graphics and info in a Zipped for mat so that you can use them and pack them up and distribute them. After all you folks would be doing the scripting which I can't do.
I feel like I am fishing trying to catch one of you folks and getting this caught and pull it in.
One Note: Please look at the post about DesktopX email and Vista SP2. You might want to see this as it might effect some or a lot of you Functions that folks use..
Thanks budAutoman
im not 100% sure what you need form me, but if you want to send me an email with a link to the theme, and what you are looking to have done, i will look into it.
Here is the link to a screenshot of this theme that shows what I am running right now:
You will see the Today weather at the Top under the top bar, and you will see the 5Day forcst at the right half way down. Hit the image ad you'll see it all.
As in the last post to you there is one last thing Weather.com changes to the evening weather ar 2:30pm eastern time thats when I show the 5Day night, so I have to figure ourt a way to build it to change the detail on the 5Day 1st day area to whats happening this evening.
If this weather gets build I will then get to get rid of a massave peice of code that checks the time and changes the program to tonight at the first part above the date and then changes the detail after the weather icon to the evening expectations forcast.
I am taking all of this info from another program called Samurize using a program dll called 2004.dll. And that went to the graveyard when the guy quit working on it and weather.com added the Advertizing. It messed up his detail on the first day for Day and night feature.
If this is built using the weather widget that is on Wincustomize.com then it will change the day an night feature automatically.
What I need to do is grab the XML file using my codes where I signed up and display each section thats already in the image. I also just need to have a way of pointing and using my own icons in a directory so that I can us the large PNG "80" Pixels for the today and the small png's "42" pixels for the 5Day forcast.
If i can get a script that Pulls the images and all I can do the rest and pass it by you, and you take the credit.
I like how you program for DesktopX so I called on the best. If you are located in the US and want to talk by phone I would be glad to just tell which area code your calling from and I will answer. I have to do that, because I am a Colonel in Special Forces BOps. so they make us screen or damn calls. If in the US there has to be a way to make contact by phone possible and that would not cripple fingers in the forum post to do this. And I am sure after we talked for just a minute at my penny that you would have it easly.
Sometimes when your trying to create something as an engineer of graphics and DesktopX scripting it gets really tough to get it all explained in the forum. After completion of the scripting object it can easly be placed as an "object or as a widget that can be imposted to the theme after downloading the theme.
I have to work on the 2 second drop down raar image of the east coast which I will place and image in the screen shot area. It uses html pages that anyone can place into their " My Web " area and use, it's really cool live radar...
Take care guy nad thanks for reading and possibly helping on this project. It is really cool I have used this for 2 years and then just re-did all the menues and graphics. I will show a "Graphics Menu" in the next screen shot and you'll see what I mean...
RomanDA;
I have just uploaded another screenshot showing the graphics menu in the middle centered and also the roll down 600mi. east coast raarscreen.
Funny thing here I am doing this and you can see the animated scuare at knoxville,tn. and I looked and we are getting read to get clobbered by bad storms. Looks better than just blank though.
Here is th Screenshot link showing the Today Weather at the top of the screen under the Topbar, and also the 5Day to the right middle also I threw in a shot of the Menu System, and last but not least the very smooth roll down east coast 600mi weather active radar.
Link is below:
https://www.wincustomize.com/skins.aspx?skinid=24943&libid=13
Let me know what ya think users are already hitting the screenshots and wanting a copy of this DesktopX theme as soon as they can get t. I must say that the menu system is one of the best I have seen in DesktopX so far......It's very easy on eyes and very usefull for all computer system and software work and at the same time you have everything except a kitchen sink.....
Let me know what you think and if you might want to tackle the weather.
Thanks a million to you ad sViz for the help..
There are many great features available to you once you register, including:
Sign in or Create Account