SVN: toys/rsget.pl: Image/AlbumEE Link/AlbumEE

pawelz pawelz at pld-linux.org
Sun Sep 19 18:07:21 CEST 2010


Author: pawelz
Date: Sun Sep 19 18:07:20 2010
New Revision: 11809

Added:
   toys/rsget.pl/Image/AlbumEE   (contents, props changed)
   toys/rsget.pl/Link/AlbumEE   (contents, props changed)
Log:
- album.ee support.


Added: toys/rsget.pl/Image/AlbumEE
==============================================================================
--- (empty file)
+++ toys/rsget.pl/Image/AlbumEE	Sun Sep 19 18:07:20 2010
@@ -0,0 +1,43 @@
+# $Id$
+# Image::AlbumEE - Image getter plugin for rsget.pl
+#
+# 2010 (c) Paweł Zuzelski <pawelz at pld-linux.org>
+#		This program is free software,
+# you may distribute it under GPL v2 or newer.
+
+name: AlbumEE
+short: I:AlbumEE
+web: "http://album.ee/"
+tos: "http://keskus.ee/page/Terms"
+uri: qr{(?:(?:en|ru)\.)?album\.ee/node/\d+/\d+}
+slots: max
+status: OK 2010-09-19
+
+unify:
+	return "http://en.album.ee/node/$1/$2"
+		if m{http://(?:ru\.)?album\.ee/node/(\d+)/(\d+)};
+
+start:
+	GET( $-{_uri} );
+
+	ERROR( "file not found" )
+		if m#Page not found#;
+
+	! m{<p class="f-left">user » <b><a href="user/\d+" title="View user profile.">(.+?)</a></b></p>};
+	my $user = $1;
+
+	! m{<p class="f-left">album » <a href="album/7631/50249339">(.+?)</a></p>};
+	my $album = $1;
+
+	! m{<p class="f-left">photo » <b>(.+?)</b></p>};
+	my $name = $1;
+
+	! m{<img src="(http://.*?)" alt="\Q$name\E"};
+	my $furi = $1;
+
+	my $fname = $user."-".$album."-".$name;
+	INFO( name => $fname, quality => "image" );
+
+	DOWNLOAD( $furi, fname => $fname );
+
+# vim: filetype=perl:ts=4:sw=4

Added: toys/rsget.pl/Link/AlbumEE
==============================================================================
--- (empty file)
+++ toys/rsget.pl/Link/AlbumEE	Sun Sep 19 18:07:20 2010
@@ -0,0 +1,28 @@
+# $Id$
+# Link:AlbumEE - Link retriever plugin for album.ee
+#
+# 2010 (c) Paweł Zuzelski <pawelz at pld-linux.org>
+#		This program is free software,
+# you may distribute it under GPL v2 or newer.
+
+name: AlbumEE
+short: L:AlbumEE
+web: "http://album.ee/"
+tos: "http://keskus.ee/page/Terms"
+uri: qr{(?:(?:en|ru)\.)?album\.ee/album/\d+/\d+}
+slots: max
+status: OK 2010-09-19
+
+start:
+	GET( $-{_uri} );
+
+	ERROR( "album not found" ) if $-{_referer} eq "http://en.album.ee/";
+
+	ERROR( "no image in album" )
+		unless m{<div class="img"><a href="node/\d+/\d+"><img src=};
+
+	my @list = map { "http://en.album.ee/".$_ } m{<div class="img"><a href="(node/\d+/\d+)"><img src=}g;
+
+	LINK( @list );
+
+# vim: filetype=perl:ts=4:sw=4


More information about the pld-cvs-commit mailing list