Skip to content

Instantly share code, notes, and snippets.

@xaiki
Created July 15, 2014 06:17
Show Gist options
  • Save xaiki/d3a5aaf972732cec829c to your computer and use it in GitHub Desktop.
Save xaiki/d3a5aaf972732cec829c to your computer and use it in GitHub Desktop.
archie imdb id
#! perl -w
use strict;
my ($login, $password);
open (my $FH, 'gpg -q --use-agent --no-tty -d ~/.authinfo.gpg |');
while (<$FH>) {
m/machine\s+archive.org/ or next;
m/login\s+(\S+)/ and do { $login = $1;};
m/password\s+(\S+)/ and do { $password = $1;};
}
die "couldn't find archive.org credencials in ~/.authinfo.gpg" unless ($login and $password);
my $identifier = 'markofzorro-1920';
my $target = 'metadata';
my $patch = '{"add":"/imdb_id", "value":"tt0011439"}';
print `curl --data-urlencode -target=$target --data-urlencode -patch="$patch" --data-urlencode access=$login --data-urlencode secret=$password http://archive.org/metadata/$identifier`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment