Skip to content

Instantly share code, notes, and snippets.

@marcusramberg
Created November 24, 2012 18:00
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 marcusramberg/4140709 to your computer and use it in GitHub Desktop.
Save marcusramberg/4140709 to your computer and use it in GitHub Desktop.
sub url_for {
my ($self, $artifact) = @_;
my $url = Mojo::URL->new($self->config->{media}->{baseurl});
$url->query('width=45&height=50&crop=true');
for my $part (split /\//, $artifact->plain_picture_link) {
$part = url_unescape $part;
utf8::decode $part;
push $url->path->parts, $part;
}
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment