Logging into to a site

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2008
Posts: 42
Reputation: tondeuse34 is an unknown quantity at this point 
Solved Threads: 2
tondeuse34's Avatar
tondeuse34 tondeuse34 is offline Offline
Light Poster

Logging into to a site

 
0
  #1
Jan 24th, 2009
Hey guys, i'm having some trouble using wget. What i'm trying do is log into a site, once its logged is to go to a certain link. And once it is there download all the files on the page, but check back later to see if any new ones are there. So far i've made up this:

Shell Scripting Syntax (Toggle Plain Text)
  1. #!/bin/sh
  2.  
  3. start() [--user=USER --password=PASS -A .pdf,.doc -r -Nc http://google.com]
  4.  
  5. new() [$new_file = wget --user=USER --password=PASS -N -A.pdf,.doc -r -Nc http://www.google.com]
  6.  
  7. if [start()] then
  8. echo Downloading files...
  9.  
  10. if [new()] then
  11. echo Found new files!...Downloadi

Whenever i attempt to use --user=USER and --password=PASS it does not log me in to the site i am using, that is my main obstacle right now. What do you guys suggest i do?, Thanks. Clipper34.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Logging into to a site

 
0
  #2
Jan 24th, 2009
Hey There,

It might have to do with the user agent string that wget passes to the site (I think it's something like wget-version). You can manipulate the --user-agent= variable to pass anything, just be careful that you don't use Mozilla as they're litigation happy (more details on the options page on wget's site regarding getting sued by them)

That's just one possibility.

Hope it helps

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC