Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 18th, 2012  |  syntax: Perl  |  size: 0.54 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/perl
  2. use strict;
  3. use LWP::Simple qw(get);
  4. use JSON;
  5. use utf8;
  6.  
  7. my $user = $ARGV[0] || die "no user";
  8. my $APIKey = ''; #Get yours at https://code.google.com/apis/console/
  9.  
  10. die 'oh you forgot to include your API key' if !$APIKey;
  11.  
  12. my $googlePlus = get "https://www.googleapis.com/plus/v1/people/${user}/activities/public?key=${APIKey}&alt=json";
  13. my $googlePlus = from_json($googlePlus);
  14.  
  15. for my $googlePost (@{$googlePlus->{items}}) {
  16.         my $Post = $googlePost->{'object'}->{'content'};
  17.         utf8::decode($Post);
  18.         warn $Post;
  19. }