Jump to content

Inet read function not working?


shanet
 Share

Recommended Posts

Hey all,

I am creating a small GUI program to basically display the time. My reasons for not putting this in the GUI forum is because I believe the problem to be with InetRead.

My code is below:

#include <inet.au3>
$time = InetRead("free.timeanddate.com/clock/i1c0zsqk/n196/fn2/fs20")

$winhandle = GUICreate("AutoIt Alerter", 300, 150)
$timetext = GUICtrlCreateLabel($time, 30, 50)
GUISetState()

While 1
    $time = InetRead("free.timeanddate.com/clock/i1c0zsqk/n196/fn2/fs20")
    GUICtrlSetData($timetext, $time)
WEnd

I think INetRead is not working, can anyone else please help?

thanks.

shanet

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:

%programfiles%/AutoIt3/autoit3.chm
Link to comment
Share on other sites

  • Developers

The url is "http://" missing but on top of that: have you checked the source of that site?

#include <inet.au3>
$time = InetRead("http://free.timeanddate.com/clock/i1c0zsqk/n196/fn2/fs20")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $time = ' & $time & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

The source of the site is as follows:

<table class="tab t100" id="c2" border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td id="c1" valign="middle">
               <a id="t1c" href="http://www.timeanddate.com/worldclock/city.html?n=196" target="_blank" title="clock provided by timeanddate.com">
                   <span id="t1">7:40:09 PM</span>
               </a>
            </td>
        </tr>
    </tbody>
</table>

Where the time automatically updates every second.

[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:

%programfiles%/AutoIt3/autoit3.chm
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...