#!/usr/bin/perl

name: ProtectLinks
short: protectlinks.com
uri: qr{protectlinks\.com/}
status: OK 2009-08-25

start:
	$_ = $-{_uri};
	
	ERROR( "unsupported uri" )
		unless m#^(.*?com/)(redirect\.php\?id=)?(\d+)#;
	
	$-{_referer} = $1 . $3;

	GET( $1 . "redirect.php?id=" . $3 );

	ERROR( "Can't find link" )
		unless m#<iframe name="pagetext".*? src="(.*?)">#;

	LINK( $1 );

# vim:ts=4:sw=4
