Bam Posted December 12, 2008 Share Posted December 12, 2008 (edited) ok heres where im at i have used _INetGetSource befor but the page is php script and u cant diriectly link to it,example URL: http://adds.aviationweather.gov/metars/index.phpit has to go to that site, type in KPIE in the edit box above METARs, then click "Submit", and then$KPIE_METAR_Array = _StringBetween($File_KPIE_METAR, "KPIE", "<")... and the url dosnt have kpie in it so it wont work (or the info i want)... any ideas?anyways heres the func so far for that script...Func UpdateMETAR() If TimerDiff($Last_METAR_Update) > 60000 Then ConsoleWrite("METAR") $File_KPIE_METAR = _INetGetSource("http://adds.aviationweather.gov/metars/index.php") $KPIE_METAR_Array = _StringBetween($File_KPIE_METAR, "KPIE", "<") If $KPIE_METAR_Array <> 0 Then $KPIE_METAR = $KPIE_METAR_Array[0] GUICtrlSetData($Label_KPIE_METAR, "KPIE " & $KPIE_METAR) EndIf $Last_METAR_Update = TimerInit() EndIf EndFunc Edited December 12, 2008 by Bam Link to comment Share on other sites More sharing options...
furrycow Posted December 12, 2008 Share Posted December 12, 2008 ok heres where im at i have used _INetGetSource befor but the page is php script and u cant diriectly link to it, example URL: http://adds.aviationweather.gov/metars/index.php it has to go to that site, type in KPIE in the edit box above METARs, then click "Submit", and then $KPIE_METAR_Array = _StringBetween($File_KPIE_METAR, "KPIE", "<")... and the url dosnt have kpie in it so it wont work (or the info i want)... any ideas? anyways heres the func so far for that script... Func UpdateMETAR() If TimerDiff($Last_METAR_Update) > 60000 Then ConsoleWrite("METAR") $File_KPIE_METAR = _INetGetSource("http://adds.aviationweather.gov/metars/index.php") $KPIE_METAR_Array = _StringBetween($File_KPIE_METAR, "KPIE", "<") If $KPIE_METAR_Array <> 0 Then $KPIE_METAR = $KPIE_METAR_Array[0] GUICtrlSetData($Label_KPIE_METAR, "KPIE " & $KPIE_METAR) EndIf $Last_METAR_Update = TimerInit() EndIf EndFunc I've done stuff like this with PHP sites before, usually you have to just follow through all the links until you get to the one you want, but the site http://adds.aviationweather.gov/metars/ gets up the same page? It would be so much easier to just use all the IE functions, just make the window invisible you dont want it to show, because then you can get the component names on the form and the like.. The text box you want to put KPIE in is called: station_ids and the submit button is called: submitmet Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
Bam Posted December 12, 2008 Author Share Posted December 12, 2008 @furrycow great idea! never thought about making IE invisable ill have to try it ty Link to comment Share on other sites More sharing options...
oMBRa Posted December 12, 2008 Share Posted December 12, 2008 #include <IE.au3> $oIE = _IECreate ("http://adds.aviationweather.gov/metars/index.php", 0, 0) $oForm = _IEFormGetObjByName ($oIE, "textForm") $oQuery = _IEFormElementGetObjByName ($oForm, "station_ids") _IEFormElementSetValue ($oQuery, "KPIE") _IEFormSubmit ($oForm) $Text = _IEBodyReadText($oIE) MsgBox(0, '', StringMid($Text, StringInStr($Text, "KPIE"))) Link to comment Share on other sites More sharing options...
Bam Posted December 12, 2008 Author Share Posted December 12, 2008 @oMBra that works realy nice thx! 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