WWW::Myspace::Comment

WWW::Myspace::Comment is a Perl module used to auto-comment your MySpace friends from Perl scripts.
Download

WWW::Myspace::Comment Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Grant Grueninger
  • Publisher web site:
  • http://search.cpan.org/~grantg/WWW-Sitebase-0.5/lib/WWW/Sitebase/Poster.pm

WWW::Myspace::Comment Tags


WWW::Myspace::Comment Description

WWW::Myspace::Comment is a Perl module used to auto-comment your MySpace friends from Perl scripts. WWW::Myspace::Comment is a Perl module used to auto-comment your MySpace friends from Perl scripts.SYNOPSISSimple module to leave a comment for each of our friends. This module is an extension of the Myspace module.my $myspace = new WWW::Myspace;my $comment = WWW::Myspace::Comment->new( $myspace );my $result = $comment->post_comments( "Just stopping by to say hi!" );Due to MySpace's security features, the post_comments method will, by default, post 50 comments each time it's run. It logs the result of each posting in a file so that it can be re-run daily without duplicating posts. The file defaults to $myspace->cache_dir/commented. It also checks each friend's profile page before posting to make sure we haven't already left a comment there. This also prevents duplicates, but is mostly designed to preserve posts (see note below).See the documentation for the post_comments method below for an example script to comment all friends using a loop.Also see the comment_myspace script that is installed with the distribution.METHODSnew( $myspace )Initialze and return a new WWW::Myspace::Comment object. $myspace is a WWW::Myspace object.Exampleuse WWW::Myspace; use WWW::Myspace::Comment;my $myspace = new WWW::Myspace;my $comment = WWW::Myspace::Comment->new( $myspace );messageRetreives/sets the message we're going to leave as a comment.friend_idsRetreives/sets the list of friendIDs for whom we're going to leave comments. $message->friend_ids( 12345, 12347, 123456 ); # Set the list of friends @friend_ids = $message->friend_ids; # Retreive the list of friendsexclusionsReturns a list of the friends we're not going to comment (because we already have). Returns the list in numerical order from lowest to highest. You probably only need this method for communicating with the user. Note that the post_comments method will also skip people with a link to our profile (i.e. in a comment) on their page. The exclusions list is 1) a safety that stops us from re-posting to pages that need to approve comments, 2) prevents us from having to read hundreds of profiles every time we run.Example( @exluded_friends ) = $comment->exclusions;commentedReturns a reference to a hash of friendIDs we've commented and the status of the attempted commenting. Reads the data from the exclusions cache file if it hasn't already been read.cache_fileSets or returns the cache filename. This defaults to "commented" in the myspace object's cache_dir ($myspace->cache_dir/commented).For convenience this method returns the value in all cases, so you can do this:$cache_file = $commented->cache_file( "/path/to/file" );exclusions_fileThis is a shortcut to "cache_file", which you should use instead. exlucsions_file is here for backwards compatibility.max_countSets or returns the number of comments we should post before stopping. Default: 50.Call max_count( 0 ) to disable counting. This is good if you can handle CAPTCHA responses and you want to stop only when you get a CAPTCHA request (i.e. if you're running from a CGI script that can pass them back to a user).html( )Sets to display HTML-friendly output (only really useful with "noisy" turned on also).Call html(1) to display HTML tags (currently just "BR" tags). Call html(0) to display plain text.Text output (html = 0) is enabled by default.Example$comment->html( 1 );delay_timeSets the number of seconds for which the post_all method will sleep after reaching a COUNTER or CAPTCHA response. Defaults to 86400 (24 hours).noisy( )Retreives/Sets "noisy" output. That is, print status messages for each post. If "html(1)" is called first, BR tags will be placed after each line so you can display it as, say, the output of a CGI script.If "noisy" is off, the post_comments method will run silently until it hits a CAPTCHA response or until it hits its max_count.set_noisy is off (0) by default.set_noisyShortcut for noisy, which you should use instead. set_noisy is here for backwards compatibility.interactiveIf set to 1, and running on MacOS X, will pop up a CAPTCHA image in Preview and prompt the user to enter it. (not yet implemented).myspaceSets/retreives the myspace object with which we're logged in. You probably don't need to use this as you'll pass it to the new method instead.post_comments( , )Posts comments to friends specified by @friend_ids. If none are given, post_comments retrieves the list of all friends using the WWW::Myspace object's get_friends method.post_comments will automatically skip all friendIDs in the "exclusions" list (see the exclusions method above). It will also scan each profile page before posting, and if a link to our profile exists on the page, it will not post. It will post until it has posted "max_count" successful posts, or until it receives a CAPTCHA request ("please enter the characters in the image above").post_comments returns a status string indicating why it stopped: CAPTCHA if a CAPTCHA image code was requested. COUNTER if it posted max_count comments and stopped. DONE if it posted everywhere it could. Requirements: · Perl


WWW::Myspace::Comment Related Software