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

I've discovred a great twitter stats scipt online but unfortunately it was written for a mac. I'm on a win32 box and would like to know what the equivalent of curl is for windows:

Here's the code:

# # I use curl and sed instead of something cleaner like LWP # # deal with it # my $status_exec = `curl --silent http://twitter.com/$user | sed -n -e +'s/.*Updates.*<span class=\"stats_count numeric\">\\(.*\\)<\\/span>.* +/\\1/p'`; $status_exec =~ tr/,//d; $statuses_count = int($status_exec) || die "Couldn't retrieve current +statuses count:\n";
Anyone point me in the right direction?

Thanks

Replies are listed 'Best First'.
Re: curl substitute
by gwadej (Chaplain) on Sep 19, 2009 at 03:10 UTC

    The comment in the code points you toward a more portable solution.

    I would use the LWP::Simple get method and regular expressions to extract what I need.

    The details are left as an exercise to the OP.<grin/>

    G. Wade
      thanks...I'm just confused about the SED equivalent on windows
        I'm just confused about the SED equivalent on windows

        For most monks, the SED equivalent on windows is Perl.

Re: curl substitute
by cmac (Monk) on Sep 19, 2009 at 03:17 UTC
    There are also versions of curl for windows:
    http://curl.haxx.se/download.html
Re: curl substitute
by jdrago_999 (Hermit) on Sep 22, 2009 at 17:55 UTC
    The sed program is only used for this regex substitution:
    s/.*Updates.*<span class=\"stats_count numeric\">\\(.*\\<\\/span>.*+/\ +\1/p

    Which could be written in Perl as:

    $str =~ s{ .*?Updates.*? <span\s+class\="stats_count\s+numeric"> (.*?) </span> }{ $1 }xs;