SVN: toys/rsget.pl/Link/Gazeta

sparky sparky at pld-linux.org
Mon Aug 2 21:43:04 CEST 2010


Author: sparky
Date: Mon Aug  2 21:43:04 2010
New Revision: 11750

Modified:
   toys/rsget.pl/Link/Gazeta
Log:
- handle FlashVars param
- don't hardcode links


Modified: toys/rsget.pl/Link/Gazeta
==============================================================================
--- toys/rsget.pl/Link/Gazeta	(original)
+++ toys/rsget.pl/Link/Gazeta	Mon Aug  2 21:43:04 2010
@@ -15,13 +15,11 @@
 start:
 	GET( $-{_uri} );
 
-	RESTART( irand( 10, 60 ), "unable to parse response, restarting" )
-		if m#<param name="FlashVars"#;
+	ERROR( "no links found" )
+		unless m{flashvars: "pid=swfObj&m=(.*?)&}
+			or m#<param name="FlashVars" value="m=(.*?)&#;
 
-	ERROR( "no links found." )
-		if ! m{flashvars: "pid=swfObj&m=http://serwisy\.gazeta\.pl/(.*?)\?xx=(\d+)%26xxd=(\d+)};
-
-	GET( 'http://serwisy.gazeta.pl/'.$1.'?xx='.$2.'&xxd='.$3 );
+	GET( uri_unescape( $1 ) );
 
 	my @list = /<p>(.*?)<\/p>/g;
 


More information about the pld-cvs-commit mailing list