Jump to content

_INetGetSource help


Bam
 Share

Recommended Posts

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
Edited by Bam
Link to comment
Share on other sites

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

#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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...