Re: Bugfix for make_atsc_chanconf.pl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

2008/1/30, Noah Magram <noah-junk@xxxxxxxxxx>:
> Hello all,
>
> The antennaweb.org scraper make_atsc_chanconf.pl is broken due to
> changes on the antennaweb.org site, specifically the need for cookies
> and an additional mapping page that gets displayed when only a zipcode
> is entered.
>
> The latest in CVS gives this error as a result:

CVS is outdated and superseded by mercurial. Regenerated patch
attached - Mike, can I have your $0.02 please?

> No such field 'stationXml' at ./make_atsc_chanconf.pl line 62
>
> I have attached a patch that gets it working again.
>
> Best,
>
> -N

Christoph
diff -r baa56aaf9a5d util/szap/channels-conf/atsc/make_atsc_chanconf.pl
--- a/util/szap/channels-conf/atsc/make_atsc_chanconf.pl	Mon Jan 28 13:50:42 2008 +0100
+++ b/util/szap/channels-conf/atsc/make_atsc_chanconf.pl	Sat Feb 02 17:15:06 2008 +0100
@@ -6,6 +6,7 @@
 
  use LWP;
  use HTML::Form;
+ use HTTP::Cookies;
  use XML::XPath;
  use XML::XPath::XMLParser;
 
@@ -37,20 +38,24 @@
  }
 
  $ua = LWP::UserAgent->new;
+ $ua->cookie_jar({});
  push @{$ua->requests_redirectable}, 'POST';
  $response = $ua->get($WEBSITE);
  if ($response->is_success) {
  	$form = HTML::Form->parse($response);
- 	$request = $form->click;
+ 	$request = $form->click("btnStart");
 	$response2 = $ua->request($request);
  	if ($response2->is_success) {
  		$form2 = HTML::Form->parse($response2);
 		$form2->param($ZIPCODE, $zipCode);
- 		$request2 = $form2->click;
+ 		$request2 = $form2->click("btnSubmit");
  		$response3 = $ua->request($request2);
- 		if ($response3->is_success) {
-			$form3 = HTML::Form->parse($response3);
- 			$xml = $form3->value($XML);
+ 		$form3 = HTML::Form->parse($response3);
+ 		$request3 = $form3->click("btnContinue");
+ 		$response4 = $ua->request($request3);
+ 		if ($response4->is_success) {
+ 			$form4 = HTML::Form->parse($response4);
+ 			$xml = $form4->value($XML);
  			$xml =~ s/%22/"/g;
  			$xml =~ s/%2c/,/g;
  			$xml =~ s/%2f/\//g;
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux