Sign in to follow this  
Followers 0
Konzine

InetGet/Read - Can it be done?

4 posts in this topic

Hello,

I am very new to AutoIt, but have worked with it maybe once or twice in the past. What I want to do is basically have a script that every 60 will check a particular webpage (example.com/getstate.php), and by the info being displayed on that webpage, probably 1 word or maybe even just a numeric value, have the script taskkill a program.

Can this be done with inetget/read?

Thanks.

Share this post


Link to post
Share on other sites



If it's a php file I think it's likely that INetGet will only get the actual file, not the value or whatever it's calculating. Have you tried yet to see what you get? It should be relatively easy...

$return = InetGet("http://example.com/getstate.php", Default, 1, 0)
ConsoleWrite($return & @CRLF)
MsgBox(0, "", $return)

Share this post


Link to post
Share on other sites

The php code I am using is;

<?php
    if ($_GET["button"] == "shutdown") {
        #save the current timestamp to a file
        $handle = fopen("timestamp.txt", "w");
        fwrite($handle, time());
        fclose($handle);
        print "saved kill message!";
    } elseif ($_GET["remote"] == "1") {
        #check the file to send kill message
        $handle = fopen("timestamp.txt", "r");
        if ($handle) {
            $buf = $handle;
            if ((time() - $buf) < 300) {
                print "#KILL";
            }
        }
    }
 ?>

Now, I am using read here, but its not posting info to remote at this point.

Share this post


Link to post
Share on other sites

You could probably just use the _IE functions...check the IE Management section in the AutoIt help file. Start with _IECreate()... to open the page. I don't think we have enough info from you to be of any more help.

Other than that, I think you need to provide the entire source of the page and/or a link to it, if available. The more info you provide the more detailed responses you'll get.

Share this post


Link to post
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
Sign in to follow this  
Followers 0