Skip Menu |

This queue is for tickets about the WWW-Myspace CPAN distribution.

Report information
The Basics
Id: 31026
Status: resolved
Priority: 0/
Queue: WWW-Myspace

People
Owner: Nobody in particular
Requestors: chump [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.74
Fixed in: (no value)



Subject: Reading friends comments - broken
When logging in and viewing friends' comments on their pages, it seems to fail to do so. This was working a couple of months ago. Please review the following code and output: CODE: --snip-- #!/opt/local/bin/perl # use strict; use warnings; use WWW::Myspace; $| = 1; my $username = $ARGV[0]; my $password = $ARGV[1]; my @friends; print "Username: $username\tPassword: $password\n"; print "Logging in... "; my $myspace = WWW::Myspace->new( $username, $password ); print "done\n"; if ( ! $myspace->logged_in ) { print "Unable to login: " . $myspace->error . "\n"; } # Get list of your friends print "Getting friends... "; @friends = $myspace->get_friends(); print "done\n"; my %friend_mapping; # key = id, value = name # Present list all nice-like foreach my $friend (@friends) { eval { print "friend id.: $friend\n"; my $friend_name = $myspace->friend_user_name($friend); print "name......: $friend_name\n"; $friend_mapping{$friend} = $friend_name; print "Getting last 5 comments.\n"; my $comments = $myspace->get_comments($friend); my $max_comments_display = 5; while ($max_comments_display > 0 && $comments) { my $comment = shift @{$comments}; my $friend_name_comment = ""; if (!$comment) { print "- Unable to get comment\n"; } else { if ($comment && exists $comment->{sender} && exists $friend_mapping{$comment->{sender}}) { $friend_name_comment = $friend_mapping{$comment- Show quoted text
>{sender}};
} else { eval { $friend_name_comment = $myspace- Show quoted text
>friend_user_name($comment->{sender})};
if ($friend_name_comment) { $friend_mapping{$comment->{sender}} = $friend_name_comment; } } if ($friend_name_comment) { print "- $friend_name_comment ($comment->{sender}) @ $comment->{date}, $comment->{time}\n$comment->{comment}\n\n"; } else { print "- N/A ($comment->{sender}) @ $comment->{date}\n"; } } $max_comments_display--; } }; if ($@) { print "Unable to complete request: $@\n"; } } --snip-- SAMPLE OUTPUT (please excuse the comments, only showing to prove it works for myself yet not for others): --snip-- christopherhumphries:~/Projects/Testing/Perl-WWW-Myspace-Examples$ /opt/ local/bin/perl getFriendComments.pl yyyyyyyyyyyyy xxxxxxxxxxxx Username: yyyyyyyyyyyyy Password: xxxxxxxxxxxx Logging in... done Getting friends... done friend id.: 210005732 name......: unixfudotnet Getting last 5 comments. - Kelly (285892570) @ Nov 27, 2007 5:52 PM, 1196203920 Thanks, bandwagon jumper =P - Kelly (285892570) @ Nov 27, 2007 5:45 PM, 1196203500 You're gay - MeTh (1637787) @ Nov 27, 2007 12:31 PM, 1196184660 thank you for the flowers... there really beautiful and a nice lunch time snack for my fat ass cat :o) - MeTh (1637787) @ Nov 27, 2007 1:13 AM, 1196143980 :::::looks all innocent:::::::: - MeTh (1637787) @ Nov 25, 2007 12:07 PM, 1196010420 umm yea..... do over? lol .. i had a good time and i think if i had to pee, i would of pee'd myself laughing... ill tyyl beebeee friend id.: 25913110 name......: queen of the metaverse Getting last 5 comments. - Unable to get comment - Unable to get comment - Unable to get comment - Unable to get comment - Unable to get comment friend id.: 101527072 name......: Saverio Getting last 5 comments. - Unable to get comment - Unable to get comment - Unable to get comment - Unable to get comment - Unable to get comment --snip-- This same code worked a couple of months ago. Was part of the WWW::Myspace article I wrote at http://perlandmac.blogspot.com/2007/08/ using-perl-wwwmyspace.html that doesn't work now. Please let me know if this is a fault in my code or your code. Thanks!
I forgot to mention that I upgraded WWW::Myspace today to the latest via CPAN. Other version info, PERL: --snip-- $ /opt/local/bin/perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=darwin, osvers=8.10.1, archname=darwin-2level uname='darwin christopher-humphries-computer.local 8.10.1 darwin kernel version 8.10.1: wed may 23 16:33:00 pdt 2007; root:xnu- 792.22.5~1release_i386 i386 i386 ' config_args='-des -Dprefix=/opt/local -Dccflags=-I'/opt/local/ include' -Dldflags=-L/opt/local/lib -Dvendorprefix=/opt/local -Dcc=/usr/ bin/gcc-4.0' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/usr/bin/gcc-4.0', ccflags ='-I/opt/local/include -fno-common - DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -Wdeclaration- after-statement -I/usr/local/include -I/opt/local/include', optimize='-O3', cppflags='-no-cpp-precomp -I/opt/local/include -fno-common - DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -Wdeclaration- after-statement -I/usr/local/include -I/opt/local/include' ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5367)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/opt/local/ lib -L/usr/local/lib' libpth=/usr/local/lib /opt/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-L/opt/local/lib -bundle -undefined dynamic_lookup -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under darwin Compiled at Jul 15 2007 17:44:42 @INC: /opt/local/lib/perl5/5.8.8/darwin-2level /opt/local/lib/perl5/5.8.8 /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level /opt/local/lib/perl5/site_perl/5.8.8 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.8 /opt/local/lib/perl5/vendor_perl . --snip-- OS: --snip-- $ uname -a Darwin christopher-humphries-computer.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/ RELEASE_I386 i386 i386 --snip
get_comments method fixed to work with myspace changes in 0.79 (uploading now).