Jump to content
Sign in to follow this  
chipmonger

Best/Correct Way for AutoIT to access data from remote user?

Recommended Posts

chipmonger

I have a need to have an AutoIT script provide information to and then retrieve information from a remote user.  The information that needs to be displayed could be done on a web page; it is a combination of text and graphic data.  I need to display this information, then retrieve the responses from the remote user and use that information to continue processing the AutoIT script.

What would be the best way to do this?

Thanks,

Chip

Share this post


Link to post
Share on other sites
Edano

What would be the best way to do this?

.

the best would be to show what you have so far.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
orbs

.

the best would be to show what you have so far.

 

@chipmonger, Edano has a good point - even if you have no code yet - your description of the task is practically a dictionary definition of the word "vague". now, anyone reading your post can interpret it in many ways, and suggest a solution that may be totally irrelevant for you, ranging from a web form application (if you have a web server to present the data, as can be presumed from your post) to a client-server TCP-based code to be deployed to your users workstations (if you are talking about LAN users).

so, help us help you, ok?

Share this post


Link to post
Share on other sites
chipmonger

Ok, I have no code yet as I was attempting to understand which was easiest/best.  I've done several small AutoIT projects in the past, but this is the first where I needed to involve presenting to and accessing from a remote external user.  I've been trying to read up prior to posting this, but haven't seen something yet that struck me as similar.

To sum the project up, AutoIT has some access to some local data.  I need for it to be able to present this data: text and/or graphics (even a link to the graphic) to a remote user.  They will post their responses to what is displayed, and then I need the AutoIT program to process their response.  I'm guess I'm being a bit vague as I don't know which way to do this.  I don't want to say I need it done 'X' way if 'Y' way would do it easier.  I should have been clearer that the users would be accessing the data in remote locations and not on a local network.

Thanks again,

Chip

Share this post


Link to post
Share on other sites
Edano

i think you will have to look into the tcp* functions for direct communication. there are pretty good examples that helped me a lot to get started. indirect communication via a website is also possible and maybe necessary to exchange ipaddresses. depending on your isp.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
chipmonger

Thanks Edano.  If I was to assume anything, I would think having AutoIT push the content to a web form and then getting the remote user's responses back would be the way to go.  I can't count on being able to give them a client program to interact with the AutoIT host program - I cannot get confirmation that remote users will always use a Windows-based computer.

Chip

Share this post


Link to post
Share on other sites
Edano

so there is no autoit program on the remote machine ?

you see you will have to eplain much more. in general, it is no problem to push or set data to a website form, if you wanted to know that. _IE* functions you need then.

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
chipmonger

No, and I don't know if it will be possible.  All I do know is the computers (whatever they are) have Internet access.

Share this post


Link to post
Share on other sites
Edano

not enough info ...


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
chipmonger

I'm helping a friend who is collaborating with school districts in rural locations.  We need to be able to show the students words and/or pictures and have the students respond back. The script will log what was sent to the students and their responses.  Another script will process this information.  We don't have access to these computers so we cannot install programs - we don't know that they will be running Windows.

What I'm thinking is that AutoIT has the information that needs to be presented to the student.  It provides the content (the text/pictures) to the web server and when the student goes to the URL that content is displayed.  The student keys in his or her answers and AutoIT get those responses back from the web server.  AutoIT does any needed processing, and then stores the data.

How to have AutoIT hand off the content to the web server, and retrieve the response is what I don't understand.

Share this post


Link to post
Share on other sites
Edano

yes. it is possible. but you have to design a website first with all the forms you need to be filled out, and load the website to the internet with an ftp client. or you can do that even online. but you need a domain (www.ruralschools.com for example). your students can visit that website and enter their responds.

then you can completely automate the input/output of the website content with the _IE* functions of autoit and process or analyze it. that is no problem.

i don't know your level of understanding all this, so you might have to google the one or the other thing.

E.


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
Edano

if you don't need privacy (that's relative, because NSA will always read everything), you can give every school their own web form address (e.g. www.ruralschools.com/school1.htm). if you need privacy, you will have to handle with passwords, that does the website hoster, and that is where my knowledge ends ... ;)

(questions for html forums then)

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites
chipmonger

I understand the need to create the web site and how the students will access it.  I've also used the _IE functions in some of my other scripts on the client side so I'm familiar enough with that to be dangerous :)

The AutoIT script in this portion wouldn't be used to read/scrape data from the web page, but provide the data for the web server to push it down to the user.  The nearest thing I've seen dealing with this is some AutoIT integration/communication with PHP on the server side or using AutoIT as a web server itself.  That's were I get a bit confused and don't want to make assumptions... :unsure:

Share this post


Link to post
Share on other sites
orbs

so, there is no client software, except the browser; and the web server presents data on a web form, and processes the user input in the same web form. so far, you describe a web application. AutoIt is used - if used at all - as pre-process (to prepare the data for the web application) and as post-process (to process the output of the web form prepared by the web application).

does this web application already exist?

Share this post


Link to post
Share on other sites
chipmonger

No it does not.  I'm trying to understand what needs to be done prior to diving in.

Share this post


Link to post
Share on other sites
orbs

i think you should start with the web application characterization. first ask yourself what input does it need, and what output does it produce. once these are known, you'll see the rest is much clearer - the web app input is the script output, so once you know what the script is expected to produce, you can then plan the script. you can then decide if a database is in order, and of what kind; etc.

Edited by orbs

Share this post


Link to post
Share on other sites
chipmonger

I understand what needs to be the inputs to the web page from AutoIt, we're looking at a graphic and a few text fields.  There will be a text field that needs to be returned to AutoIT from the web server. 

In doing some further research, it looks like the AutoIt CGI Handler may be the ticket.  My only concern is that there hasn't been many posts regarding it for two years.

Share this post


Link to post
Share on other sites
orbs

not that i'm trying to discourage you or anything, but if you are about to write a web application anyway, then why not make this web application able to retrieve the required data by itself, and also process the response by itself? i'm not a web developer, but i'm sure that any language you code a web application is quite capable of accessing local data like files and databases.

that aside, if you know what data is required from the AutoIt pre-process to provide, then next questions would be: where should it get that data from? does it compute the data by itself, or does it perform manipulation on existing data, already located in files or database?

jumping forward, then i'll ask you: how does it suppose to deliver the data to the web application? to answer that, answer this: how does the web application read the data? does it expect the data in specific format, in specific folder, under specific file names? or does it use IPC of some kind? that depends on the capabilities of the web application, this is why i asked you if you already have it coded.

you have a dazzling scope of possibilities here. to get in focus, try pseudo-coding your process. write, in human language, using real details, something like this:

script is reading file D:WebAppdata.csv

script is processing the data to create a chart, saving it to D:WebAppToSitechart.jpg

script is reading file D:WebAppmetadata.txt

script is formatting the data as html, saving it to D:WebAppToSitetext.htm

script is waiting for the file D:WebAppFromSiteformdata.ini to change

webapp is reading file D:WebAppToSitetext.htm

webapp is updating the web page with the html text

webapp is placing the image D:WebAppToSitechart.jpg in the web page

webapp is presenting form fields in the web page

webapp is waiting for user to click "submit"

webapp is reading the form fields data from the web page

webapp is writing the form data to file D:WebAppFromSiteformdata.ini

script is reading file D:WebAppFromSiteformdata.ini

script is doing something with the data

a lot of work, but you can instantly see where are your difficulties. again, i'm not a web developer, and i don't know what are the abilities you require from your web app and how you are going to implement them. that's why i'm forced into offering a general solution. you will need to do the details.

and about the CGI handler - i have no idea what it does or what it can do, or does it comply with your web app. but i have a feeling that you will need to do the same pseudo-coding for whatever method you choose.

now i'm going to get my wrists and fingers massaged, and my keyboard replaced  ;)

Share this post


Link to post
Share on other sites
chipmonger

First, I just want to say thanks for taking the time to write a detailed and thoughtful response.  I truly appreciate it.  The web page is going to rather basic, just a graphic and/or text fields.  One text box for the user to type a response.  I'd rather not code everything while learning a new language, but perform most of the lifting in AutoIt while passing off to the web server what needs to be displayed and done within it.

Thanks again,

Chip

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  

×