Jump to content



Photo

Weather Desktop Widget


  • Please log in to reply
41 replies to this topic

#1 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 26 April 2011 - 06:18 PM

All updates are now kept at: https://sourceforge.net/projects/weatherwidget/

This is still being created (The GUI) so some of the labels will be out of alignment ($OverViewTime & $OverViewStatus) if you get an out-of-aligned label (IE, not centered) then please let me know what the exact text is by going to Weather.com and putting in the zip code you used and got the error.

If you get a MsgBox that states "Error" then please do the same as above, but this time tell me what the labels are for "Right Now", "Tomorrow", "Tonight" etc. etc.

The UDF will get all the information needed from Weather.com and the script will create a GUI to display all the information.

Screenshots:

On Run Request Zip Code
(My cute bunny :unsure:)
Posted Image


Right Now Gui (Default)
Posted Image

Context Menu (To change GUI's/Refresh/Close)
Posted Image

[Source]
Attached File  WeatherUDF.au3   3.82K   478 downloads


[Widget]
Attached File  Widget.au3   9.76K   454 downloads


Let me know what you think!

Edited by Damein, 02 April 2012 - 03:16 PM.

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic





#2 guinness

guinness

    guinness

  • MVPs
  • 10,288 posts

Posted 26 April 2011 - 06:22 PM

Nice, a lot different from my _GoogleWeather UDF :unsure:

Tested: And I'm getting $Temp1 in _GetOverViewTemperature() not being declared, plus is this only for the USA?

Edited by guinness, 26 April 2011 - 08:30 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


#3 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 26 April 2011 - 06:40 PM

Thanks, I hope to include a ton more stuff to it.

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#4 kaotkbliss

kaotkbliss

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,106 posts

Posted 26 April 2011 - 06:51 PM

Looks very impressive :unsure: It just might replace the default weather widget on my pc
Posted Image010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My first project Allin1 Program launcherBill CalculatorGot <Insert problem here>?There's an AutoIt script for that!

#5 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 26 April 2011 - 08:09 PM

Am i the only one ho can't use it?
What Zip code should i type, and how to get it?
Why the user can't type city, as on the website, why the zip code?

Anyway, i geting many syntax errors, even if i type my home zip code.
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#6 guinness

guinness

    guinness

  • MVPs
  • 10,288 posts

Posted 26 April 2011 - 08:30 PM

After my initial post of seeing the images I decided to have a play and unlike my UDF it appears there are errors with the SRE's.

And to answer your question MrCreatoR, it appears the URL is to blame e.g. http://www.weather.com/weather/today/washingtondc doesn't work, but a ZIP code will. At least Google is a little forgiving.

Edited by guinness, 26 April 2011 - 08:34 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


#7 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 27 April 2011 - 12:32 PM

Hmph, for some reason Weather.com decided to use "CHance of Rain" instead of "Chance of Precip:" which is what I use to have. I'll do a little tweaking and post the results.

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#8 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 27 April 2011 - 03:01 PM

*** EDIT ***

Alright, I fixed the problem with precipitation. FOr now everything should work, and yes, its zip code only and USA (Unless Weather.com can locate you)

I will be releasing another version in a few days, but I will go ahead and release the fixed bug one.

First post is updated.

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#9 CodyBarrett

CodyBarrett

    I LOVE Juicy Fruit!!!

  • Active Members
  • PipPipPipPipPipPip
  • 1,225 posts

Posted 27 April 2011 - 04:05 PM

looks good

#10 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 27 April 2011 - 05:45 PM

Thank you, and thanks Kaotkbliss, let me know how it works out for you!

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#11 kaotkbliss

kaotkbliss

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,106 posts

Posted 27 April 2011 - 06:37 PM

I'm not getting the weather pic and had to move the $OverViewStatus to the left a little but other than that I can't wait to see what you add to it :unsure:
Posted Image010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My first project Allin1 Program launcherBill CalculatorGot <Insert problem here>?There's an AutoIt script for that!

#12 boththose

boththose

    that means two things

  • Active Members
  • PipPipPipPipPipPip
  • 886 posts

Posted 27 April 2011 - 06:41 PM

I concur, status of "Sunny / Windy" hangs off the edge.

see todays weather for (http://www.weather.com/weather/today/76504)

However I am getting the pic, nicely done.

Edited by iamtheky, 27 April 2011 - 06:42 PM.

Spoiler

#13 kaotkbliss

kaotkbliss

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,106 posts

Posted 27 April 2011 - 06:42 PM

Perhaps a StringLen() check will help the varying sized text stay mostly centered?
Posted Image010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My first project Allin1 Program launcherBill CalculatorGot <Insert problem here>?There's an AutoIt script for that!

#14 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 27 April 2011 - 06:45 PM

Alright, thanks. And yeah, a StringLen might do nicely, I know of a few things I need to adjust (Including after like, 9PM the Overview changes from Right Now, Today, Tonght, Tomorrow > Right Now, Tonight, Tomorrow, Tomorrow Night) so I need to do a little adjusting to allow that instead of the other menu. But thanks so far :unsure:

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#15 boththose

boththose

    that means two things

  • Active Members
  • PipPipPipPipPipPip
  • 886 posts

Posted 27 April 2011 - 06:55 PM

or if there are multiple status just return the first, Im sure my regexp is horrible but it seems to make due.

    If $i = 1 Then         If stringregexp ($status1[0] , "(.*?)/(.*?)") Then         $SplitStatus = stringsplit ($Status1[0] , "/" , 3)     $OverViewStatus[1] = $SplitStatus[0] Else     $OverViewStatus[1] = $Status1[0]     Endif

Spoiler

#16 coffeeturtle

coffeeturtle

    Wayfarer

  • Active Members
  • Pip
  • 82 posts

Posted 25 November 2011 - 06:29 PM

Hello Damein! Thank you for posting your UDF and sample code.

When running your example code with the weather.udf, I get this error:

C:\Program Files\AutoIt3\Include\WeatherUDF.au3 (83) : ==> Subscript used with non-Array variable.:
$OverViewStatus[2] = $Status2[0]
$OverViewStatus[2] = $Status2^ ERROR

This also happens with previous lines that reference $image1[0], etc.

Thanks for looking into it, if you have a spare moment.

:D

#17 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 25 November 2011 - 07:29 PM

Weather.com must of changed some stuff, give me a few minutes and I'll see what I can do. Gotta freshen up on the code :D

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#18 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 25 November 2011 - 08:14 PM

Ah, they changed the way they pass the URL for the website.

I figured out how to do it, but I'm going to have to play with it to get everything right.

For starters I had to add this to the Example Script:

$ZipCode = InputBox("Zip code", "Please input your zip code") $ZipCode2 = "<a href='http://www.zip-codes.com/zip-code/' class='bbc_url' title='External link' rel='nofollow external'>http://www.zip-codes.com/zip-code/"</a> & $ZipCode Global $sSource = BinaryToString(InetRead($ZipCode2)) $City = StringRegExp($sSource,'(?i)(?s)<tr valign="top"><td id="rowB"><a href="/zip_database_fields.asp#city" class="rowL" target="_blank">City:</a></td><td id="rowB"><a href="(.*?)">(.*?)</a>',1) $State = StringRegExp($sSource,'(?i)(?s)<tr valign="top"><td id="rowA"><a href="/zip_database_fields.asp#statecode" class="rowL" target="_blank">State:</a></td><td id="rowA"><a href="(.*?)">(.*?)</a>',1) $Url = 'http://www.weather.com/weather/today/' & $City[1] & '+' & $State[1] & '+' & $Zipcode


So I have the right URL now, and I can pull data, but it might take me a few days until I can sit down and setup all the StringRegExp.

If you want, you can always do it, it shouldn't be hard after that. All you have to do in the UDF for now is replace all the:

Global $sSource = BinaryToString(InetRead("<a href='http://www.weather.com/weather/today/' class='bbc_url' title='External link' rel='nofollow external'>http://www.weather.com/weather/today/"</a> & $ZipCode))


To be:

Global $sSource = BinaryToString(InetRead($Url))


Thanks for bringing this up, I will look into it.

Edited by Damein, 25 November 2011 - 08:14 PM.

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

#19 ChrisN

ChrisN

    Wayfarer

  • Active Members
  • Pip
  • 72 posts

Posted 25 November 2011 - 10:22 PM

I have regular expressions that return data for today & for today+9 days. I'll post them if you could use them. :-)

#20 Damein

Damein

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 364 posts

Posted 26 November 2011 - 03:58 AM

If you want go ahead, I'll check 'em out :D

Posted Image

Most recent sig. I made

YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users