Good Evening,
The code i wrote here isn't the best. Please bear with me.

When it executes it spews out a bunch of mechanize warnings which i am not sure what it means. Execution is by command line

filename.pl user@email.com whateverpassword

This looks at a certain website and grabs all your friends and messages a happy b-day greeting if their b-day is today.

#!/usr/bin/perl -w use strict; my $MONTH=qr/(January|February|March|April|May|June|July|August|Septem +ber|October|November|December)(?=[^a-zA-Z])/; my @abbr = qw(January February March April May June July August Septem +ber October November December); use WWW::Mechanize; my $url = "http://www.facebook.com"; my $m = WWW::Mechanize->new(); $m->get($url); $m->submit_form(form_name=>"loginform", fields=>{email=>$ARGV[0], pass +=>$ARGV[1]}); $m->get("/bdaycal.php"); my $b= $m->content(); $b=~/.... Birthdays(.*?)Facebook /g; $b=$1; $b=~s|(http://\w+\.facebook.com/profile\.php\?id=\d+)| > $1_<|g; $b=~s/<[^>]*>//g; $b=~s/Give a Birthday Gift \| Post a Birthday Flyer//g; $b=~s/&nbsp;//g; my @C = split /$MONTH/,$b; shift @C; my %B=@C; my $count=0; my %O; for (keys %B){ while ($B{$_}=~s/^(\d\d)-(.*?)(\d\d-.*)$/$3/){ my $day = $1*1; my @T=split ",",$2; my @S; foreach my $t(0..$#T){ my ($id,$age,$name); $id=($T[$t]=~s/([^_]+)_//)?$1:""; $age=($T[$t]=~s/\(age (\d\d)\)//)?$1:""; $name=$T[$t]; $O{$_}->{$day}->[$t]= {id=>$id, age=>$age, name=>$name }; $count++; } } }; my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time +); $mon=$abbr[$mon]; for (@{$O{$mon}->{$mday}}){ $m->get($_->{id}); print $_->{name}; my $Form=0; for ($m->forms){ $Form++; last if $_->find_input ("wall_text"); } print ((($m->submit_form(form_number=>$Form, fields=>{wall_text=>" +Happy Birthday!"}))?" - Success":" - Failed"),"\n"); }

The Errors that it produces:

Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055 Use of uninitialized value in substitution iterator at /usr/share/perl +5/URI/_query.pm line 16. Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055 Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055 Unknown input type 'search' at /usr/local/share/perl/5.8.8/WWW/Mechani +ze.pm line 2055

The warnings seem to come only after get() requests. Any guidance would help. As well this is WWW::Mechanize ver 1.32. This is also likely something that I should have noticed.


In reply to WWW::Mechanize Unknown input type 'search' by zer

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.