Skip to content

Instantly share code, notes, and snippets.

@acotie
Created November 29, 2009 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acotie/244775 to your computer and use it in GitHub Desktop.
Save acotie/244775 to your computer and use it in GitHub Desktop.
my $username = 'username';
my $password = 'pass';
# uranai_data
my $filename = './mezaura.yaml';
my $data = YAML::LoadFile($filename);
my $twit = Net::Twitter->new(username => $username, password => $password);
my $count = 1;
for ( my $i=11; $i >= 0; $i-- ){
my $date = $data->{date};
my $rank = $data->{ranking}[$i]->{rank};
my $star = $data->{ranking}[$i]->{star};
my $text = $data->{ranking}[$i]->{text};
my $outputs;
if ($rank == "01"){
$outputs = $date ." ". $rank. "位 ". $star .": ". $text;
} else {
$outputs = $rank. "位 ". $star .": ". $text;
}
my $result = $twit->update($outputs);
$count++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment