LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-31-2006, 01:23 PM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Rep: Reputation: 35
shell script to submit web POST data?


All,

As a "quickfix" on a Linux system we have, there is a need to get a shell script to submit a form on a webpage. I assume netcat is the way to go, but do not know how to proceed to make the statement.

In short, we have an application interface problem where one application can run a shell-script with parameters, and the other one (at partner location, for the moment outside out control) uses a web form to receive input.

Now - the question is, this application should select radio-button one, push submit and that's it. Obviously I can very easily do this in Konqueror, but to write a shell-script that gets the http form-post/get problem correct is different.

Can anyone please help me out?

Thanks!

-Y1
 
Old 10-31-2006, 03:57 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
curl and wget can both correctly post forms in a script. check google for examples of doing it, as it' snot something i've personally done, but i know it's more than doable.
 
Old 11-01-2006, 03:09 PM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks. A bit more stubborn Googling found the program I was looking for - http://www.w3.org/ComLine/ - the program is w3c and it works like a charm

-Y1
 
Old 11-01-2006, 04:40 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
that's just a cut down version of wget and curl... why not just use the non-obselete proof-of-concept tools already on your system? of course... whatever works is fine at the end of the day.
 
Old 11-03-2006, 04:05 AM   #5
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks. You're right - curl seems to do just the same as w3c, but as you say - curl is standard and maintained, and w3c is not. Will experiment some more and try the curl-way.

Just out of curiousity - do I need wget at all for this? All I want to do is to submit a value to a web-page form, I don't need to get anything...

-Y1

Edit: fix typo

Last edited by Yalla-One; 11-03-2006 at 04:38 AM.
 
Old 11-03-2006, 05:21 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
well essentially wget and curl are very very similar, and largely down to personal preference. i prefer wget, but know that curl is slightly more powerful in some areas.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read data from file to use in shell script? ozymandias Linux - Newbie 7 10-27-2006 02:19 PM
CGI shell script (GET/POST?) metalx1000 Programming 1 09-20-2006 08:27 PM
is this php automatic form submit post wriiten correctly? fsock error.. verbatim Programming 1 05-11-2005 11:24 AM
shell script: sending data through the serial port funkymunky Programming 2 06-10-2004 12:47 AM
shell script form submit precioso77 Linux - General 2 05-18-2003 12:50 PM


All times are GMT -5. The time now is 03:23 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration