xmltv/grab/uk_atlas tv_grab_uk_atlas,1.24,1.25

Geoff <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/grab/uk_atlas
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv6238

Modified Files:
	tv_grab_uk_atlas 
Log Message:
(minor) fix Perl error when filtering empty programmes hash (credit: ta264)
(minor) report error returned by Atlas when status 400 received

Index: tv_grab_uk_atlas
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/uk_atlas/tv_grab_uk_atlas,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** tv_grab_uk_atlas	12 Jul 2014 07:02:57 -0000	1.24
--- tv_grab_uk_atlas	1 Aug 2014 09:29:04 -0000	1.25
***************
*** 172,176 ****
  
  # ------------------------------------------------------------------------------------------------------------------------------------- #
! # Progress Bar :)
  $bar = new XMLTV::ProgressBar({
    name => "Filtering duplicates",
--- 172,178 ----
  
  # ------------------------------------------------------------------------------------------------------------------------------------- #
! # Filter duplicate programmes
! if (defined $programmes) {
! 
  $bar = new XMLTV::ProgressBar({
    name => "Filtering duplicates",
***************
*** 184,187 ****
--- 186,190 ----
  $bar->finish() && undef $bar if defined $bar;
  
+ }
  
  
***************
*** 323,328 ****
  						get_schedule_from_json($xmlchannel_id, $res->content, \$channelname, \$channelicon);
  				} else {
  						# error - format as a valid http status line for cgi script
! 						print STDERR "Status: ".$res->status_line."\n";
  				}
  					
--- 326,337 ----
  						get_schedule_from_json($xmlchannel_id, $res->content, \$channelname, \$channelicon);
  				} else {
+ 						# get the specific error if poss
+ 						my $error = '';
+ 						if ($res->content) {
+ 							my $data = JSON::PP->new()->utf8(1)->decode($res->content);
+ 							$error = $data->{'error'}->{'message'} if defined $data->{'error'}->{'message'};
+ 						}
  						# error - format as a valid http status line for cgi script
! 						print STDERR "Status: ".$res->status_line.($error ne ''?" ($error)":'')."\n";
  				}
  					
***************
*** 1709,1712 ****
--- 1718,1724 ----
  You will need to enter your API key during the --configure stage.
  
+ Remember to request Press Association (PA) as the content provider on your
+ Atlas API key. 
+ 
  2.
  Grabber configuration consists of the usual:  
***************
*** 1882,1885 ****
--- 1894,1900 ----
  Typically this is because you haven"t entered your API key during the 
  --configure stage.
+ Or your API key does not allow access to Press Association data (log-in to your 
+ account at http://atlas.metabroadcast.com/admin and "Request Access" to "PA" 
+ source data).
  Or if you requested a particular channel with the --channel option but the 
  channel cannot be found.


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.