Hello all:

I have been looking for examples to retrieve a list of image files from a remote directory (http - standard apache index) to load into an array so I can get the 10 most recent and copy them to my server (via getstore). There are typically only 20-40 images in this directory at any given time that are being rotated out. There are other things that I am doing after that with imagemagick, but I have that handled.

I have found a few examples, but they require robot or scraping modules, I am on a shared server and I am trying to do this with the modules that are installed. I am not really scraping, as I am only hitting the one remote server, and have permission to do so.

I am usually good at getting things to work if I have good examples to go by, but I've been searching for a week now and not having much luck. Worse case, the files follow a certain format, with a date and time in the file name (they are just not sequential). I could always do a loop starting from "now" and do a getstore for every possible name until I retrieve 10 existing files, but I would think there has to be some way to get a list of files in a remote directory without getting too carried away.

Thank you for the help!

John


In reply to Remote Directory listing by johnfl68

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.