GEOSoft Posted April 9, 2009 Share Posted April 9, 2009 Canada English: http://www.google.ca/ig/api?weather= George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 10, 2009 Share Posted April 10, 2009 The reply that comes back from Google is a Unicode XML document. If you save this to a local file on your system then perhaps it's running a default conversion from Unicode to your local codepage. This would then prevent it from loading correctly in the XML parser. WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
Zedna Posted April 10, 2009 Share Posted April 10, 2009 The reply that comes back from Google is a Unicode XML document. If you save this to a local file on your system then perhaps it's running a default conversion from Unicode to your local codepage. This would then prevent it from loading correctly in the XML parser.WBDIt's not Unicode. It only contains accented characters (ASCI > 128) which are problematic in _XMLOpen() part.I think those characters should be somehow encoded, maybe %hex_number or something similar. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
nobbe Posted April 10, 2009 Author Share Posted April 10, 2009 updates first post i added a litte chart for temperatures (google.chart.api) Link to comment Share on other sites More sharing options...
Squirrely1 Posted April 10, 2009 Share Posted April 10, 2009 It's not Unicode. It only contains accented characters (ASCI > 128) which are problematic in _XMLOpen() part.I think those characters should be somehow encoded, maybe %hex_number or something similar.I haven't tested this, but in the call to _XMLFileOpen he should maybe pass a version number as the second parameter...$objDoc = _XMLFileOpen($infile, 3)It seems like the latest parser should be able to read these characters - if not, I think there is a international government conspiracy at work to prevent it because I am a congenital conspiracy theorist. Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
GEOSoft Posted April 10, 2009 Share Posted April 10, 2009 (edited) updates first post i added a litte chart for temperatures (google.chart.api)Chart is a nice addition but I'm not sure just how useful it will be. In the meantime you have a problem in the GUI when using the German site and perhaps others. The Label for wind conditions won't hold the data. You may have to take the controls for Current conditions out of the Array and create them separately. Resizing the Window isn't enough. EDIT: Tip -- Remove all of your GUICtrlSetFont() lines and place this below the GUICreate() GUISetFont(8, 800, 0, "Arial") Edited April 10, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
GEOSoft Posted April 10, 2009 Share Posted April 10, 2009 (edited) Another issue has just popped up. As you noticed in the PM, If I use Google.com or anything except google.ca, the current info and the image fields are blank. This is rectified by using google.ca however the images on google.ca are png images. I've solved the issue of getting the correct image in my modified functions but you may want to make a note of this in case someone else has the same problem. I will PM you the code that I'm using. EDIT: I just found where all the problems are. Google is in the midst of changing the Weather API. I have another function that I'm working on to solve that problem and another with the way °C and °F are handled. Slight delay while I finish. Edited April 10, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Zedna Posted April 11, 2009 Share Posted April 11, 2009 (edited) I googled for MSXML details and here it is:Character Encoding and MSXMLhttp://msdn.microsoft.com/en-us/library/ms757065(VS.85).aspxEnforcing Character Encoding with DOMhttp://msdn.microsoft.com/en-us/library/ms761374(VS.85).aspxMSXML DOM Referencehttp://msdn.microsoft.com/en-us/library/ms764730(VS.85).aspxAnother nice web page about this problem:http://www.w3schools.com/XML/xml_encoding.aspGoogle weather has only head without encoding like this <?xml version="1.0"?>So after download your encoding should be manually added <?xml version="1.0" encoding="ISO-8859-2"?>Here is related AU3 code:Global $infile = @ScriptDir & "\weather.xml"; InetGet("http://www.google.cz/ig/api?weather=Brno", $infile, 1, 0) $text = FileRead($infile) $text = StringReplace($text, '<?xml version="1.0"?>', '<?xml version="1.0" encoding="ISO-8859-2"?>') FileDelete($infile) FileWrite($infile, $text) Edited April 11, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
nobbe Posted April 11, 2009 Author Share Posted April 11, 2009 thanks zedna i put it in to the code (updated first post) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now