diff options
author | Florian Pritz <bluewind@server-speed.net> | 2011-05-15 14:02:38 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@server-speed.net> | 2011-05-15 14:02:38 +0200 |
commit | 2a85f5f9ca4fe5b758b489f02f9ec0d0aff55587 (patch) | |
tree | 34274a0e70db49a0a51cb37d08e19d969ee8831c | |
parent | fcb85132b3bb40f054cb775cbffe0e412f064ce6 (diff) | |
download | bin-2a85f5f9ca4fe5b758b489f02f9ec0d0aff55587.tar.gz bin-2a85f5f9ca4fe5b758b489f02f9ec0d0aff55587.tar.xz |
add new scripts
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
-rwxr-xr-x | dropbox_gallery_dl.pl | 20 | ||||
-rwxr-xr-x | round-corners.sh | 10 | ||||
-rwxr-xr-x | urldecode | 16 |
3 files changed, 46 insertions, 0 deletions
diff --git a/dropbox_gallery_dl.pl b/dropbox_gallery_dl.pl new file mode 100755 index 0000000..8b22af8 --- /dev/null +++ b/dropbox_gallery_dl.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Data::Dumper; +use WWW::Mechanize; +use LWP::Simple; + +my $url = $ARGV[0]; + +my $mech = WWW::Mechanize->new(); + +$mech->get($url); + +my $content = $mech->content(); +while ($content =~ m/^\s*'filename': '(.*)',$/mg) { + my $img_name = $1; + $content =~ m/^\s*'original': "(.*)"$/mg; + my $img_url = $1; + getstore($img_url, $img_name); +} diff --git a/round-corners.sh b/round-corners.sh new file mode 100755 index 0000000..62b984d --- /dev/null +++ b/round-corners.sh @@ -0,0 +1,10 @@ +#!/bin/zsh + +for i in "$@"; do +convert $i \ + \( +clone -alpha extract \ + -draw 'fill black polygon 0,0 0,8 8,0 fill white circle 8,8 8,0' \ + \( +clone -flip \) -compose Multiply -composite \ + \( +clone -flop \) -compose Multiply -composite \ + \) -alpha off -compose CopyOpacity -composite rounded_$i.png +done diff --git a/urldecode b/urldecode new file mode 100755 index 0000000..19df702 --- /dev/null +++ b/urldecode @@ -0,0 +1,16 @@ +#!/bin/bash +arg="$1" +i="0" +while [ "$i" -lt ${#arg} ]; do + c0=${arg:$i:1} + if [ "x$c0" = "x%" ]; then + c1=${arg:$((i+1)):1} + c2=${arg:$((i+2)):1} + printf "\x$c1$c2" + i=$((i+3)) + else + echo -n "$c0" + i=$((i+1)) + fi +done + |