Solved

Getting information from the Web

Posted on 1997-05-17
7
250 Views
Last Modified: 2013-12-25
Hello.
Is there a way I can get information from the Web without CGI.
I need to get information from the Web, record it into a file (text file) and thats all. I have shell account and I know more or less UNIX.
NOTE: If it is so I gonna increse the puntuation

Thanks.
0
Comment
Question by:cacost
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
Fordream earned 100 total points
ID: 1828030
That is possible but why don't you use CGI??
 However, if you have unix shell account, you can make a program running in background that makes the result HTML file. Or you can also use at or cron.
 I guess the 'information' means variable information like weather information. Am I wrong?
 For example, yes, you are to make weather information page without CGI. You can make main page(index.html) that refers weather.html and program that updates weather.html everyday.
 Client-requesting method is impossible without CGI or very special way because program should be able to get query from web. And ... you may not mean 'constant information', you do?
 Bye

0
 

Author Comment

by:cacost
ID: 1828031
Thanks
1.- I don't know much about CGI and have not cgi access.
2.- What is this:   at or cron.
3.- Yes you are right information are variables. Can I record it into a file.

What I need is to get just 1 line (8 letters) from the Web and put it into a file. For example I have I file like this:
Smith
John
David

and I want get the word Charles from the web and update my file to:
Smith
John
David
Charles

and so over and over again. If I can please tell me how



0
 
LVL 1

Expert Comment

by:Fordream
ID: 1828032
1. CGI is not hard. It's easy when you know UNIX. It's just like UNIX programming. What you have to do for CGI is change some input/output format from general unix program(whatever it is shell script or perl or C program..).
 You said you do not have CGI access but I don't think so. in the most case, you can make CGI program when you have shell prompt. Check your HTTP demon again.

2. AT is a utility that runs a program on time you want. For example, you can make it to mail file list of your diretory to someone on 5/21 10:00.AM., and you can whatever you want on reserved time.
 CRON is a utility like AT. But AT runs programs once. CRON runs program periodically(everymonth, everyday, or everyhour). For example you can make it to check system and mail report every monday...
 These utilities doesn't mean important to do what you want. They can be used to make periodically updated information.

3. To do what you want, you have to use CGI because it needs query data("just 1 line" is it.) You can do what you said as example with simple work. But it is impossible or very hard to get information from Web without CGI.

0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 

Author Comment

by:cacost
ID: 1828033
Hello, again.
Thanks.
1.- O.K. How do I combine my Unix script in order to receive one line from the web?
2.- I know how to use crontab (I have a daemon running into my account with crontab).

Thanks again. You are very pacient.


0
 

Author Comment

by:cacost
ID: 1828034
Check the value again Fordream
0
 
LVL 1

Expert Comment

by:Fordream
ID: 1828035
Thanks cacost. and sorry for late answer... I didn't have time to come Experts-Exchange.

1. First, you make a form in html file to input one line like following:

<form action="submit.cgi" method=get>
Please input what you want to input:
<input type=text name=data size=9 maxlength=8>
<p>
Then please submit the data!
<input type=submit name=Submit>
</form>

 This will make to get a line from web and submit the data to submit.cgi with GET method. GET method? GET method is one of CGI data-posting method. there are two methods: GET and POST. GET sends data to CGI as program arguments(argv[] variable in C, and $1,$2... in Shell script or Perl), and POST sends data to CGI as STDIN (Standard Input Stream)... GET method is easier to use but it can't accept large mount of data.

 Then, let's make the CGI. I recommend several CGI libraries because it is so annoying to make routine for CGI program(query data phrasing, character converting, etc...). And careless in these may occur security problem. You can get many CGI libraries for C or Perl from Web(Try to enter "CGI" on yahoo query!).

 Query data is sent as this form:

name=value;name=value;name=value...

 In above case, inputed line will be sent like this:

data=Smith
data=Jones
.
.

 The program must separate each input data (in this case it is not necessary because input data is only one.) and name and value in each data.
 In using GET method, your CGI will get data as program arguments. Pharse the data using CGI-Library and process(Add data to file, mail him something or whatever), and output the result, then it's done.
 In CGI output, you should put CGI header in head of output.
 CGI header is usually this string:

Content-Type: text/html
(a blank line)

 and CGI library may have a routine to output header.

2. crontab is not necessary in this case ;). forget it.

 Oh it is very difficult to explain how to do. moreover I can't speak English well... I hope you to get a good CGI library and read the manual and example file. It is not too hard if you know Unix. If you have any trouble in making, mail me to (ddongper@aminet.co.kr). I'll try to help you as I can. Or please explain me exactly what operation you want then I could make you the HTML and CGI as well.
0
 

Author Comment

by:cacost
ID: 1828036
Thanks!!.
I'll try all what you said, however if it doesn't work at all I have learned a lot.

Thanks, my e-mail is aacosta@planetall.com
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need sample Angular apps for study 4 102
AWS CLI issues with Tags 3 87
Sums of coloumns in html/java 15 80
remove computer from using logon script 17 38
Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question