Jump to content



Photo

_GoogleWeather() - a UDF to find details about the weather in a certain region


  • Please log in to reply
12 replies to this topic

#1 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 28 December 2010 - 11:09 PM

This is a UDF that uses the 'undocumented' Google Weather API. Documentation has been provided in the UDF with a couple of examples too. Enjoy.

WARNING: This UDF has been deprecated due to Google closing the doors on the (unsupported) Weather API. I have left the code as it is so others may learn from it.

Posted Image

GUI Example of using the _GoogleWeather UDF

UDF:
AutoIt         
#include-once ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ; #INDEX# ======================================================================================================================= ; Title .........: _GoogleWeather ; AutoIt Version : v3.3.2.0 or higher ; Language ......: English - uses https://www.google.com ; Description ...: Retrieves details about the weather in a specific region, using the 'undocumented' Google Weather API. ; Note ..........: ; Author(s) .....: guinness ; Remarks .......: ; =============================================================================================================================== ; #INCLUDES# ==================================================================================================================== ; None ; #GLOBAL VARIABLES# ============================================================================================================ ; None ; #CURRENT# ===================================================================================================================== ; _GoogleWeather_Current: Retrieves details about the current weather status in a specific region. ; _GoogleWeather_Forecast: Retrieves details about the 4 day forecast for a specific region. ; _GoogleWeather_Get: Retrieves all data that will be parsed from the Google Weather API. ; _GoogleWeather_Information: Retrieves details about the general forecast information. ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ; __GoogleWeather_CelsiusToFahrenheit ......; Converts from Celsius to Fahrenheit ; __GoogleWeather_FahrenheitToCelsius ......; Converts from Fahrenheit to Celsius ; __GoogleWeather_GetIPLocation ............; Retrieves the IP City location ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GoogleWeather_Current ; Description ...: Retrieves details about the current weather status in a specific region. ; Syntax ........: _GoogleWeather_Current([$sRead = -1]) ; Parameters ....: $sRead               - [optional] Only data returned from _GoogleWeather_Get(). Default is IP location. ; Return values .: Success - Returns a 1D Array. $aArray[6] = [Number of Items, Condition data, Temp in F, Temp in C, Icon URL, Wind condition] ;                  Failure - Returns -1 & sets @error to non-zero ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _GoogleWeather_Current($sRead = -1)     Local $aXML[7] = [6, "condition data", _             "temp_f data", _             "temp_c data", _             "humidity data", _             "icon data", _             "wind_condition data"]     Local $sConditions = "current_conditions", $sReturn     If $sRead = -1 Then         $sRead = _GoogleWeather_Get()     EndIf     If @error Then         Return SetError(1, 0, -1)     EndIf     $sReturn = StringRegExp($sRead, "<(?i)" & $sConditions & ">(.*?)</(?i)" & $sConditions & ">", 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = $sReturn[0]     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?i)<' & $aXML[$A] & '="(.*?)"/>', 3)         If @error Then             Return SetError(1, 0, 0)         EndIf         If $aXML[$A] = $aXML[2] Then             $sReturn[0] = $sReturn[0] & ChrW(176) & "F"         EndIf         If $aXML[$A] = $aXML[3] Then             $sReturn[0] = $sReturn[0] & ChrW(176) & "C"         EndIf         If $aXML[$A] = $aXML[5] Then             $sReturn[0] = "https://www.google.com" & $sReturn[0]         EndIf         $aXML[$A] = $sReturn[0]     Next     If @error = 0 Then         Return $aXML     EndIf     Return SetError(1, 0, -1) EndFunc   ;==>_GoogleWeather_Current ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GoogleWeather_Forecast ; Description ...: Retrieves details about the 4 day forecast for a specific region. ; Syntax ........: _GoogleWeather_Forecast([$sRead = -1[, $iTemperature = 1]]) ; Parameters ....: $sRead               - [optional] Only data returned from _GoogleWeather_Get(). Default is IP location. ;                  $iTemperature        - [optional] Use Fahrenheit (0) or Celsius (1). Default is 1. ; Return values .: Success - Returns a 2D Array. $aArray[5][5] = $aArray[0][0] - Number of Items ;                                                                [0][1] - Number Of Columns ; ;                                                                $Array[A][0] - Day of the week ;                                                                [A][1] - Temp high in C/F ;                                                                [A][2] - Temp low in C/F ;                                                                [A][3] - Icon URL ;                                                                [A][4] - Condition data ;                  Failure - Returns -1 & sets @error to non-zero ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _GoogleWeather_Forecast($sRead = -1, $iTemperature = 1)     Local $aXML[5] = ["day_of_week data", _             "high data", _             "low data", _             "icon data", _             "condition data"]     Local $iSize, $sConditions = "forecast_conditions", $sReturn, $sReturnTest     If $sRead = -1 Then         $sRead = _GoogleWeather_Get()     EndIf     If @error Then         Return SetError(1, 0, -1)     EndIf     $sReturn = StringRegExp($sRead, "<(?i)" & $sConditions & ">(.*?)</(?i)" & $sConditions & ">", 3)     $iSize = UBound($sReturn, 1)     Local $aReturn[$iSize + 1][5] = [[$iSize, 5]]     For $A = 0 To $iSize - 1         $sRead = $sReturn[$A]         For $B = 0 To $aReturn[0][1] - 1             $sReturnTest = StringRegExp($sRead, '(?i)<' & $aXML[$B] & '="(.*?)"/>', 3)             If $aXML[$B] = $aXML[1] Or $aXML[$B] = $aXML[2] Then                 Switch $iTemperature                     Case 0                         $sReturnTest[0] = $sReturnTest[0] & ChrW(176) & "F"                     Case 1                         $sReturnTest[0] = __GoogleWeather_FahrenheitToCelsius($sReturnTest[0])                 EndSwitch             EndIf             If $aXML[$B] = $aXML[3] Then                 $sReturnTest[0] = "https://www.google.com" & $sReturnTest[0]             EndIf             $aReturn[$A + 1][$B] = $sReturnTest[0]         Next     Next     If @error = 0 Then         Return $aReturn     EndIf     Return SetError(1, 0, -1) EndFunc   ;==>_GoogleWeather_Forecast ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GoogleWeather_Get ; Description ...: Retrieves all data that will be parsed from the Google Weather API. ; Syntax ........: _GoogleWeather_Get([$sLocation = -1]) ; Parameters ....: $sLocation           - [optional] Specify a location to retrieve the weather information for. Default is IP location. ; Return values .: Success - Returns data retrieved from the Google Weather API. ;                  Failure - Returns -1 & sets @error to non-zero ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _GoogleWeather_Get($sLocation = -1)     Local $bRead, $sRead     If $sLocation = -1 Then         $sLocation = __GoogleWeather_GetIPLocation()     EndIf     $bRead = InetRead("https://www.google.com/ig/api?weather=" & $sLocation)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = BinaryToString($bRead)     Return $sRead EndFunc   ;==>_GoogleWeather_Get ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GoogleWeather_Information ; Description ...: Retrieves details about the forecast information. ; Syntax ........: _GoogleWeather_Information([$sRead = -1]) ; Parameters ....: $sRead               - [optional] Only data returned from _GoogleWeather_Get(). Default is IP location. ; Return values .: Success - Returns a 1D Array. $aArray[6] = [Number of Items, City data, Postal data, Forecast data, Current time, Unit system] ;                  Failure - Returns -1 & sets @error to non-zero ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func _GoogleWeather_Information($sRead = -1)     Local $aXML[6] = [5, "city data", _             "postal_code data", _             "forecast_date data", _             "current_date_time data", _             "unit_system data"]     Local $sReturn     If $sRead = -1 Then         $sRead = _GoogleWeather_Get()     EndIf     If @error Then         Return SetError(1, 0, -1)     EndIf     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?i)<' & $aXML[$A] & '="(.*?)"/>', 3)         If @error Then             Return SetError(1, 0, 0)         EndIf         $aXML[$A] = $sReturn[0]     Next     If @error = 0 Then         Return $aXML     EndIf     Return SetError(1, 0, -1) EndFunc   ;==>_GoogleWeather_Information ; #INTERNAL_USE_ONLY#============================================================================================================ Func __GoogleWeather_CelsiusToFahrenheit($iTemperature)     Return Round($iTemperature * (9 / 5) + 32) & ChrW(176) & "F" EndFunc   ;==>__GoogleWeather_CelsiusToFahrenheit Func __GoogleWeather_FahrenheitToCelsius($iTemperature)     Return Round(($iTemperature - 32) * (5 / 9)) & ChrW(176) & "C" EndFunc   ;==>__GoogleWeather_FahrenheitToCelsius Func __GoogleWeather_GetIPLocation()     Local $aXML[5] = [4], $bRead, $sRead, $sReturn     $bRead = InetRead("http://ip.xxoo.net/")     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp($sRead, '(?s)(?i)<B>IP Address:</B>(.*?)<script type="text/javascript">', 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = $sReturn[0]     $sReturn = StringRegExp($sRead, '(?s)(?i)<div align="left">(.*?)</div>', 3)     If @error Then         Return SetError(1, 0, -1)     EndIf     $sRead = $sReturn     For $A = 1 To $aXML[0]         If $A - 1 = 1 Then             $sReturn = StringRegExp($sRead[$A - 1], '(?s)(?i)A(.*?) ', 3)             If @error Then                 ContinueLoop             EndIf             $sRead[$A - 1] = $sReturn[0]         EndIf         $aXML[$A] = $sRead[$A - 1]     Next     If @error = 0 And $aXML[2] <> "" Then         Return $aXML[2]     EndIf     Return SetError(1, 0, -1) EndFunc   ;==>__GoogleWeather_GetIPLocation

Example use of Function:
AutoIt         
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <Array.au3> ; Required only for _ArrayDisplay(), but not the UDF. #include "_GoogleWeather.au3" ; Include the _GoogleWeather.au3 UDF. Example_2() Func Example_2()     ; Get the weather information for New York.     Local $sLocation = _GoogleWeather_Get("New York")     ; Retrieve information for the current weather, passing the data returned by _GoogleWeather_Get.     Local $aReturn = _GoogleWeather_Current($sLocation)     _ArrayDisplay($aReturn, "_GoogleWeather_Current()")     ; Retrieve the forecast for the next 4 days, passing the data returned by _GoogleWeather_Get.     $aReturn = _GoogleWeather_Forecast($sLocation)     _ArrayDisplay($aReturn, "_GoogleWeather_Forecast()")     ; Retrieve general information about the current location and forecast, passing the data returned by _GoogleWeather_Get.     $aReturn = _GoogleWeather_Information($sLocation)     _ArrayDisplay($aReturn, "_GoogleWeather_Information()") EndFunc   ;==>Example_2

All of the above has been included in a ZIP file.
Previous downloads: 125

Edited by guinness, 08 October 2012 - 04:07 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013






#2 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 29 December 2010 - 09:39 AM

Cheers Deathbringer! Yeh it does support those types of locations. I didn't actually document them because I was being a little lazy :x

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#3 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 05 January 2011 - 11:01 PM

Updated: Now the UDF will grab the city based on the WAN IP Address, it can be slow depending on how fast your internet connection is and how busy the IP retrieval service is.

Check out _GoogleWeather_Get() for more details. You can decide whether the Function grabs your location via the IP Address or using a generic location.

Edited by guinness, 05 January 2011 - 11:02 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#4 boththose

boththose

    that means two things

  • Active Members
  • PipPipPipPipPipPip
  • 886 posts

Posted 06 January 2011 - 12:16 AM

No luck for US IP Addresses. For my IP it returns Salado, United States (though it is tagged correctly on their google map). With no state information the return from google is null. I will hunt for a more granular Geographic IP tool.

This works for my city (well close enough) in your UDF.

Func __GetIPLocation()     Local $aXML[5] = [4], $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.ip2location.com/' class='bbc_url' title='External link' rel='nofollow external'>http://www.ip2location.com/"</a> , 1)     $sRead = BinaryToString($bRead)     $sReturn = StringRegExp ($sRead , '<span id="Livedemo1_lblLocation" class="fontgraysmall">(.*?)</span></td>' , 3)     $sSplit = stringsplit ($sReturn[0], ",")     $sCombo = $sSplit[3] & " , " & $sSplit[2]     Return $sCombo EndFunc   ;==>__GetIPLocation FOR US CITIES!!

Edited by iamtheky, 06 January 2011 - 12:30 AM.

Spoiler

#5 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 06 January 2011 - 12:33 AM

Very weird indeed. Right now I am using http://ip.xxoo.net/ to extract the City & Country. If you know of a better site then please let me know. I know of http://xml.utrace.de/ but I was put off by their disclaimer >> http://en.utrace.de/api.php

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#6 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 06 January 2011 - 12:35 AM

OK, just saw you update. I did see ip2location.com but again I am concerned about their TOU >> http://www.ip2location.com/termsofuse.aspx

Other than that is the UDF easy to understand?

Edited by guinness, 06 January 2011 - 12:43 AM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#7 boththose

boththose

    that means two things

  • Active Members
  • PipPipPipPipPipPip
  • 886 posts

Posted 06 January 2011 - 01:00 AM

It is indeed nicely done, and trust that if I can understand and edit it then you have succeeded in making it simple.

TOUs are sketchy at best, worthless most of the time. Terms like 'reverse-engineering' and 'data-mining' have no clear meaning, is viewing the source reverse-engineering? is getting the information by any other means than a browser 'data-mining'?

Unless you are going to sell it I would not begin to worry, and then I would be concerned about crawling an uninterested third party site for information.

Here is an example with a transparent GUI (and a different source for geolocation):

AutoIt         
#include <Array.au3> ; Required only for _ArrayDisplay(), but not the UDF! #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <file.au3> #include <GUIConstants.au3> #include <WinAPI.au3> #include <SendMessage.au3> #include <IE.au3> Opt("GUIOnEventMode", 1) Opt("GUICloseOnESC", 1) _Example_2() Func _Example_2()     Local $Current, $Forecast,  $Location = _GoogleWeather_Get() ; <<<<< Will use the IP default location.     $Current = _GoogleWeather_Current($Location) ;~     _ArrayDisplay($Current, "_GoogleWeather_Current()")     $Forecast = _GoogleWeather_Forecast($Location) ;~     _ArrayDisplay($Forecast, "_GoogleWeather_Forecast()")     $Info = _GoogleWeather_Information($Location) ;~     _ArrayDisplay($Info, "_GoogleWeather_Information()") $TomTempHi = stringtrimright ($Forecast[1][1], 2) $TomTempLo = stringtrimright ($Forecast[1][2], 2) $AvgTemp = ($TomTempHi + $TomTempLo) / 2 Global $gui = GUICreate("", 250, 200, @DesktopWidth - 250, @DesktopHeight - 200 , $WS_POPUP , $WS_EX_LAYERED) GUISetBkColor(0x01, $gui) $id=GUICtrlCreateLabel($Info[1] & "          " & $Info[3],50,25,200,100) GUICtrlSetfont($id,20 , 600) GUICtrlSetcolor($id,0xFF0000) $Ver = GUICtrlCreateLabel("It's " & $Current[2] & " and " & $Current[1] ,55,60,200,100) GUICtrlSetfont($Ver,10,600) GUICtrlSetcolor($Ver,0x000000) $SEC = GUICtrlCreateLabel("Tomorrow will be " &  $Forecast[1][4] & " with an average temperature of " & $AvgTemp & " degrees.",55,80,200,100) GUICtrlSetfont($SEC,10,600) GUICtrlSetcolor($SEC,0x000FF) _WinAPI_SetLayeredWindowAttributes($gui, 0x01, 255) GUISetState(@SW_SHOW) while 1 GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_CLOSE") wend EndFunc   ;==>_Example_2 ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 ; #INDEX# ======================================================================================================================= ; Title .........: _GoogleWeather ; AutoIt Version : v3.3.2.0 or higher ; Language ......: English - uses www.google.com ; Description ...: Retrieves details about the weather in a specific region, using the 'undocumented' Google Weather API. ; Note ..........: ; Author(s) .....: guinness ; Remarks .......: ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ; _GoogleWeather_Current: Retrieves details about the current weather status in a specific region. ; _GoogleWeather_Forecast: Retrieves details about the 4 day forecast for a specific region. ; _GoogleWeather_Get: Retrieves all data that will be parsed from the Google Weather API. ; _GoogleWeather_Information: Retrieves details about the general forecast information. ; =============================================================================================================================== ; #INTERNAL_USE_ONLY#============================================================================================================ ; __CelsiusToFahrenheit ......; Converts from Celsius to Fahrenheit ; __FahrenheitToCelsius ......; Converts from Fahrenheit to Celsius ; __GetIPLocation ............; Retrieves the IP City location ; =============================================================================================================================== ; #FUNCTION# ========================================================================================================= ; Name...........: _GoogleWeather_Current() ; Description ...: Retrieves details about the current weather status in a specific region. ; Syntax.........: _GoogleWeather_Current([$sRead]) ; Parameters ....: $sRead - [Optional] Only data returned from _GoogleWeather_Get() [Default = IP location] ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[6] = [Number of Items, Condition data, Temp in F, Temp in C, Icon URL, Wind condition] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GoogleWeather_Current($sRead = -1)     Local $aXML[7] = [6, "condition data", _             "temp_f data", _             "temp_c data", _             "humidity data", _             "icon data", _             "wind_condition data"]     Local $sReturn, $sConditions = "current_conditions"     If $sRead = -1 Then $sRead = _GoogleWeather_Get()     If @error Then Return SetError(1, 1, -1)     $sReturn = StringRegExp($sRead, "<(?i)" & $sConditions & ">(.*?)</(?i)" & $sConditions & ">", 3)     If @error Then Return SetError(1, 1, -1)     $sRead = $sReturn[0]     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?i)<' & $aXML[$A] & '="(.*?)"/>', 3)         If @error Then Return SetError(1, 1, 0)         If $aXML[$A] = $aXML[2] Then $sReturn[0] = $sReturn[0] & ChrW(176) & "F"         If $aXML[$A] = $aXML[3] Then $sReturn[0] = $sReturn[0] & ChrW(8451)         If $aXML[$A] = $aXML[5] Then $sReturn[0] = "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a> & $sReturn[0]         $aXML[$A] = $sReturn[0]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GoogleWeather_Current ; #FUNCTION# ========================================================================================================= ; Name...........: _GoogleWeather_Forecast() ; Description ...: Retrieves details about the 4 day forecast for a specific region. ; Syntax.........: _GoogleWeather_Forecast([$sRead]) ; Parameters ....: $sRead - [Optional] Only data returned from _GoogleWeather_Get() [Default = IP location] ;                  $iTemperature - [Optional] 0 = Use Fahrenheit or 1 = Use Celsius [Default = 1] ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 2D Array. $Array[5][5] = $Array[0][0] - Number of Items ;                                                               [0][1] - Number Of Columns ; ;                                                               $Array[A][0] - Day of the week ;                                                               [A][1] - Temp high in C ;                                                               [A][2] - Temp low in C ;                                                               [A][3] - Icon URL ;                                                               [A][4] - Condition data ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GoogleWeather_Forecast($sRead = -1, $iTemperature = 0)     Local $aXML[5] = ["day_of_week data", _             "high data", _             "low data", _             "icon data", _             "condition data"]     Local $sReturn, $sConditions = "forecast_conditions"     If $sRead = -1 Then $sRead = _GoogleWeather_Get()     If @error Then Return SetError(1, 1, -1)     $sReturn = StringRegExp($sRead, "<(?i)" & $sConditions & ">(.*?)</(?i)" & $sConditions & ">", 3)     Local $iSize = UBound($sReturn, 1)     Local $aReturn[$iSize + 1][5] = [[$iSize, 5]], $sReturnTest     For $A = 0 To $iSize - 1         $sRead = $sReturn[$A]         For $B = 0 To $aReturn[0][1] - 1             $sReturnTest = StringRegExp($sRead, '(?i)<' & $aXML[$B] & '="(.*?)"/>', 3)             If $aXML[$B] = $aXML[1] Or $aXML[$B] = $aXML[2] Then                 Switch $iTemperature                     Case 0                         $sReturnTest[0] = $sReturnTest[0] & ChrW(176) & "F"                     Case 1                         $sReturnTest[0] = __FahrenheitToCelsius($sReturnTest[0])                 EndSwitch             EndIf             If $aXML[$B] = $aXML[3] Then $sReturnTest[0] = "<a href='http://www.google.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com"</a> & $sReturnTest[0]             $aReturn[$A + 1][$B] = $sReturnTest[0]         Next     Next     If Not @error Then Return $aReturn     Return SetError(1, 1, -1) EndFunc   ;==>_GoogleWeather_Forecast ; #FUNCTION# ========================================================================================================= ; Name...........: _GoogleWeather_Get() ; Description ...: Retrieves all data that will be parsed from the Google Weather API. ; Syntax.........: _GoogleWeather_Get([$sLocation]) ; Parameters ....: $sLocation - [Optional] Specify a location to retrieve the weather information for. [Default = IP location] ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns data retrieved from the Google Weather API. ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GoogleWeather_Get($sLocation = -1)     If $sLocation = -1 Then $sLocation = __GetIPLocation() ; <<<<< Slower, but a little more accurate. ;~  If $sLocation = -1 Then $sLocation = "New York" ; <<<<< Un-comment to use a generic location.     Local $bRead, $sRead     $bRead = InetRead("<a href='http://www.google.com/ig/api?weather=' class='bbc_url' title='External link' rel='nofollow external'>http://www.google.com/ig/api?weather="</a> & $sLocation)     If @error Then Return SetError(1, 1, -1)     $sRead = BinaryToString($bRead)     Return $sRead EndFunc   ;==>_GoogleWeather_Get ; #FUNCTION# ========================================================================================================= ; Name...........: _GoogleWeather_Information() ; Description ...: Retrieves details about the forecast information. ; Syntax.........: _GoogleWeather_Information([$sRead]) ; Parameters ....: $sRead - [Optional] Only data returned from _GoogleWeather_Get() [Default = IP location] ; Requirement(s).: v3.3.2.0 or higher ; Return values .: Success - Returns a 1D Array. $Array[6] = [Number of Items, City data, Postal data, Forecast data, Current time, Unit system] ;                  Failure - Returns -1 & sets @error = 1 ; Author ........: guinness ; Example........; Yes ;===================================================================================================================== Func _GoogleWeather_Information($sRead = -1)     Local $aXML[6] = [5, "city data", _             "postal_code data", _             "forecast_date data", _             "current_date_time data", _             "unit_system data"]     Local $sReturn     If $sRead = -1 Then $sRead = _GoogleWeather_Get()     If @error Then Return SetError(1, 1, -1)     For $A = 1 To $aXML[0]         $sReturn = StringRegExp($sRead, '(?i)<' & $aXML[$A] & '="(.*?)"/>', 3)         If @error Then Return SetError(1, 1, 0)         $aXML[$A] = $sReturn[0]     Next     If Not @error Then Return $aXML     Return SetError(1, 1, -1) EndFunc   ;==>_GoogleWeather_Information ; #INTERNAL_USE_ONLY#============================================================================================================ Func __CelsiusToFahrenheit($iTemperature)     Return Round(($iTemperature * (212 - 32) / 100 + 32)) & ChrW(176) & "F" EndFunc   ;==>__CelsiusToFahrenheit Func __FahrenheitToCelsius($iTemperature)     Return Round(($iTemperature - 32) / 1.8) & ChrW(8451) EndFunc   ;==>__FahrenheitToCelsius Func __GetIPLocation()     Local $aXML[5] = [4], $bRead, $sRead, $sReturn     $bRead = InetRead("<a href='http://www.whatismyipaddress.com/' class='bbc_url' title='External link' rel='nofollow external'>http://www.whatismyipaddress.com/"</a> , 1)     $sRead = BinaryToString($bRead) $sReturnCity = StringRegExp ($sRead , '<tr><th>City:</th><td>(.*?)</td></tr>' , 3) $sReturnState = StringRegExp ($sRead , '<tr><th>Region:</th><td>(.*?)</td></tr>' , 3)     $sCombo = $sReturnCity[0] & " , " & $sReturnState[0] ;~  msgbox (0, '' , $sCombo)     Return $sCombo EndFunc   ;==>__GetIPLocation FOR US CITIES!! ; #INTERNAL_USE_ONLY#============================================================================================================ Func GUI_Close()     GUIDelete($gui)     Exit EndFunc

Edited by iamtheky, 06 January 2011 - 05:04 PM.

Spoiler

#8 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 06 January 2011 - 11:47 PM

Nice Example :x I wasn't able to run it as there were some errors, but I got the idea. Hope you don't mind but I tidied it up a bit and removed some
of the Includes that weren't required.

Posted Image

Edited by guinness, 08 October 2012 - 03:52 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#9 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 26 April 2011 - 09:26 PM

I made a small syntax update to the OP and updated the GUI Example.

Edited by guinness, 26 April 2011 - 09:26 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#10 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 6,797 posts

Posted 26 April 2011 - 10:50 PM

Nice Example :unsure: I wasn't able to run it as there were some errors, but I got the idea. Hope you don't mind but I tidied it up a bit and removed some of the Includes that weren't required. And Thanks for the improved __GetIPLocation() still a little concerned about their TOS also >> http://whatismyipaddress.com/terms-of-use

I noticed in the TOU for whatismyipaddress this line:

•You may not use a script, agent, application or otherwise query this website in an automated fashion without prior written permission

From that line it's a violation of their TOS to use it the way that the _GetIP function inside Inet.au3 does it. Unless someone got written permission from them.

How to ask questions the smart way!

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.

Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.

_FileGetProperty - Retrieve the properties of a file SciTE Toolbar - A toolbar demo for use with the SciTE editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#11 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 16 October 2011 - 01:14 PM

I've updated the UDF with improved syntax and an improved GUI example. I've also included everything in a ZIP file this time. See the original post for details.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#12 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 28 March 2012 - 05:27 PM

I've updated the UDF with the following changes. Please see original post for details. Thanks.

- CHANGED: Now uses https rather than http.
- IMPROVED: Examples, by adding more comments.
- IMPROVED: Source code of UDF by tidying it up and removing unwanted variables.
- IMPROVED: Conversion of temperatures.


Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#13 guinness

guinness

    guinness

  • MVPs
  • 10,234 posts

Posted 08 October 2012 - 03:52 PM

This UDF has been deprecated due to Google closing the doors on the (unsupported) Weather API. I have left the code as it is so others may learn from it. Thanks to all who used it.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users