Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I use this to send txt messages to my cell when my Paypal balance changes.
#!/usr/bin/perl # silent11 # 11/16/2004 use strict; use warnings; my $paypal_email = ""; my $paypal_pass = ""; my $notify_from = ""; my $notify_to = ""; my $balance_file = "balance.txt"; my $balance = return_balance(); # # # Get notified via email (or cell phone txt msg) # # # of Paypal balance changes notify_me( $balance ) if compare( $balance ); # # # Subs # # # sub return_balance { use WWW::Mechanize; my $browser = WWW::Mechanize->new(); $browser->get(""); $browser->form(1); $browser->field("login_email", $paypal_email); $browser->field("login_password", $paypal_pass); $browser->click(); $browser->follow("click here to reload"); my $html = $browser->content; # Please don't laugh at the regex ;^) It works! $html =~ /(.*history">\$)(\d+\.\d+) (USD)/s; return $2; } sub compare { use Tie::File; # First time to use Tie::File # very cool! tie my @balance, 'Tie::File', $balance_file || die $!; my $new_balance = shift; my $cur_balance = $balance[0]; $balance[0] = $new_balance; untie @balance; return 1 if ($new_balance != $cur_balance); } sub notify_me { use MIME::Lite; my $msg = MIME::Lite->new( From => $notify_from, To => $notify_to, Subject => 'Paypal Balance', Data => $balance ); $msg->send || die $!; }

Update: changed http to https per zentra's suggestion.

Spread Firefox

In reply to Get notified of Paypal balance changes by silent11

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    [Lady_Aleena]: I don't want to have to do: alpha_menu($hash, undef, $type);
    [Lady_Aleena]: Or what Discipulus said.
    [shmem]: Lady_Aleena: geany supports ctags.
    [Discipulus]: a good compromise can be my ($need, $opts_ref) = @_ a scalar and an hash reference
    [Discipulus]: see you monks!
    [Lady_Aleena]: shmem, let me get this sub rewritten, then I will look into how to use ctags in geany. Deal? 8)
    [shmem]: Discipulus: yeah, that might eventually prepare the path for OO ;-)
    [Lady_Aleena]: See you, Discipulus.
    [shmem]: Lady_Aleena: that's up to you. I only wanted to show you a path that might be more comforting than command line grep ;-)
    [Lady_Aleena]: shmem, I don't think any of my modules could be converted to OO. They are too procedural.

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (8)
    As of 2017-04-27 12:25 GMT
    Find Nodes?
      Voting Booth?
      I'm a fool:

      Results (506 votes). Check out past polls.