Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

WebFetch::Slashdot

by primus (Scribe)
on Jan 30, 2003 at 20:09 UTC ( [id://231424]=perlquestion: print w/replies, xml ) Need Help??

primus has asked for the wisdom of the Perl Monks concerning the following question:


Hail Monks,

i was wondering if any of you were familiar with the WebFetch module. I am trying to use the WebFetch::Slashdot module and the url it defaults to is "http://www.slashdot.org/slashdot.xml" (line 44) this used to work, but now slashdot only seems to let you use "http://slashdot.org/slashdot.xml" has anyone else experienced this problem?

i know i could just change the value in the pm, but in the documentations it says you can specify an alt_url, "The optional --alt_url parameter allows you to select a different URL to get the headlines from."

the documentation gives an example of the usage, but i dont think i am doing it correctly... they say
perl -w -MWebFetch::Slashdot -e "&fetch_main" -- --dir directory [--alt_url url [--alt_file file]
and i have tried
perl -w -MWebFetch::Slashdot -e "&fetch_main" -- --dir D:\ [--alt_url http://slashdot.org/slashdot.xml]
if i do it this way it returns a page not found, and if i do it
perl -w -MWebFetch::Slashdot -e "&fetch_main" -- --dir D:\ --alt_url http://slashdot.org/slashdot.xml
i get an unknown option error.

i dont know what i am missing here, thanks for the help monks!

Replies are listed 'Best First'.
Re: WebFetch::Slashdot
by theguvnor (Chaplain) on Jan 31, 2003 at 03:26 UTC

    I doubt it's the real problem, but as an aside, when using Perl I never use a backslash ("\") as my directory separator, as you have to worry about creating unintended escape-sequences (you'd really want to write it as "D:\\" if you insist on using backslashes). You are much better off using a forward-slash ("/") as directory separator when working with Perl; this gives you cross-platform compatibility.

    Jon

      i totally agree, but either way i still get "alt_url" unknown option... thanks for the heads up though.
Re: WebFetch::Slashdot
by sauoq (Abbot) on Jan 30, 2003 at 21:23 UTC

    I think that putting double quotes around the URL will do the trick.

    -sauoq
    "My two cents aren't worth a dime.";
    
      no such luck, thanks for the reply though...

      i tried:
      perl -w -MWebFetch::Slashdot -e "&fetch_main" -- --dir D:\ --alt_url " +http://slashdot.org/slashdot.xml"

      and
      perl -w -MWebFetch::Slashdot -e "&fetch_main" -- --dir D:\ [--alt_url +"http://slashdot.org/slashdot.xml"]

      neither worked...

        What happened when you tried the first one?

        You can quit attempting it with the square brackets... that won't help. The brackets are commonly used in documentation to indicate that the arguments contained in them are optional.

        -sauoq
        "My two cents aren't worth a dime.";
        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://231424]
Approved by TStanley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found