Results 1 to 3 of 3

Thread: Gas price, weather and such - suggestion...

  1. #1
    Constant Bitrate jeep642's Avatar
    Join Date
    Sep 2006
    Location
    Chevy Chase, MD
    Posts
    189

    Gas price, weather and such - suggestion...

    Yesterday I was driving thinking about my install and I had some sort of epiphany...

    May be itīs stupid or doesnīt make sense but since I donīt know Iīd rather ask people who do.

    Here it is:

    Iīm using the boost mobile phone to access the internet, it works even though itīs pretty slow. Iīm basically only using it to get weather and gas prices.
    The thing is that wit such a slow connection it takes quite a little while before showing it on the screen.

    Is it right to say that, for example, weather downloader, access whatever website that contains the prices or forecast you re looking for, extract it and then sends it to RR ?

    If so, wouldnīt it be faster to have all this info loaded somewhere on a server that refreshes them every, letīs say, 30 minutes, and have weatherdownloader.exe access this server where it can take just the info it needs instead of going through a all website to get them.

    Does it make sense or weatherdownloader.exe doesnīt work like this and all this is useless ???
    _____________________________________________


    If you made your own skin, visit
    The CAR PC NETWORK SKIN PAGE

    at the

    CAR PC NETWORK

    _____________________________________________

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,817
    the native weather info in RR comes from specific XML data from weather.com using their SDK, it doesn't really go through web pages looking for what it needs. If you wish for it to work on the background, you just have to call "RELOADWEATHER" for instance while idle in the audio player.. that way when you open the weather screen it will be already loaded up. There are several ways of doing this automatically too.

    On the gas prices though, you may be right.. I didn't do that part of the code, so I'm not sure what could be done to speed it up for you, specially when the information you need on that is most likely LINKED to where you are, meaning if you get it cached, the info you got earlier won't be of any use 30 minutes away from where you got it.
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  3. #3
    FLAC Chuck's Avatar
    Join Date
    Sep 2003
    Location
    Ellicott City, MD
    Posts
    1,671
    I have an auto weather updater autoit in my skin.

    Here is the script to give you an idea.

    Code:
    ; Author:        CHUCK, 
    TraySetIcon("sunny.ico")
    ;set error trap for crash if RoadRunner closed before script
    $oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
    
    $RR = ObjCreate("RoadRunner.SDK")
    $CELLPHONE = $RR.GetInfo("=$CELLPHONE$")
    $RRpath = $RR.GetInfo("=$RRPATH$")
    $Weather = (""&$RRpath&"myweather.xml")
    $Temp = (""&$RRpath&"myweatherNEW.xml")
    $WeathPing = (""&$RRpath&"WeatherPing.gif")
    
    InetGet('http://image.weather.com/web/blank.gif', $WeathPing, 1)
    
    If FileExists($WeathPing) Then 
    	$RR.Execute("AUTORELOADWEATHER")
    	If $CELLPHONE = "1"  Then
    		sleep(15000)
    	Else
    		Sleep(10000)
    	EndIf
    Else
    	$RR.Execute("BYVAR;NETDETECT;NOINTERNET<<WEATHERNOGOOD<<NOINTERNET<<WEATHERNOGOOD")
    	EXIT
    EndIf
    
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)	
    If Not FileExists($Weather) Then Sleep(1000)	
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then Sleep(1000)
    If Not FileExists($Weather) Then 
    	$RR.Execute("BYVAR;NETDETECT;<<WEATHERNOGOOD<<<<WEATHERNOGOOD")
    	FileDelete($WeathPing)
    	FileDelete($Temp)
    	Exit	
    EndIf
    
    FileCopy ($Weather , $Temp, 1)
    $CountLines = _FileCountLines($Temp)
    
    IF $CountLines > 50 THEN 
    	$RR.Execute("BYVAR;NETDETECT;<<WEATHERDONE<<<<WEATHERDONE")
    	FileDelete($WeathPing)
    	FileDelete($Temp)
    	Sleep(20000)
    	FileDelete($Weather)
    	Exit
    Else
    	$RR.Execute("BYVAR;NETDETECT;<<WEATHERNOGOOD<<<<WEATHERNOGOOD")
    	FileDelete($WeathPing)
    	FileDelete($Temp)
    	Exit
    EndIf
    
    Func _FileCountLines($sFilePath)
    	Local $N = FileGetSize($sFilePath) - 1
    	If @error Or $N = -1 Then Return 0
    	Return StringLen(StringAddCR(FileRead($sFilePath, $N))) - $N + 1
    EndFunc
    
    ; error capture function for when RoadRunner is closed before script.
    Func MyErrFunc()
    	If hex($oMyError.number,8) = 80010108 Then
    		$RR.Execute("BYVAR;NETDETECT;<<WEATHERNOGOOD<<<<WEATHERNOGOOD")
    		EXIT
    	Else
    	EndIf
    	Endfunc
    2001 S10 ZR2

    Chucks Skin - to old

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •