bpa wrote: 
> I wondered whether "redirect" may have been in use for a period  - just
> never noticed it.
> 
> My gut feel was an URL change - just didn't twig station name change
> especially after being told local radio still worked.
> 
> I've come up with a similar solution - prefer to update XMLin for images
> array and will stick with 30 day as I think Extra feed may go away.

May I request a user configurable 'day limit' ? Reason is that my poor
old SheevaPlug will totally grind to a halt with 30 day listings. As
might some other older NAS.

I've been leery in the past of adjusting XMLin in case there are
unexpected 'side effects' on other parts of the structure. But I haven't
looked at it in ages, and I always forget quite how it works.

I did start to look at the BBC regular schedule listings. There's a nice
bit of JSON embedded in the html at present, which could be helpful.
Perhaps food for future thought.


Code:
--------------------
    
  #!/usr/bin/perl
  
  use LWP::Simple;
  use JSON::PP;
  use Data::Dump;
  
  my $channel_id = 'p00fzl7j'; # Radio 4 FM
  my $schedule_date = '2018/w37';
  $schedule_date = 'last_week';
  $schedule_date = 'this_week';
  my $url = "https://www.bbc.co.uk/schedules/${channel_id}/${schedule_date}";;
  
  my $html = get($url);
  # thanks to get_iplayer
  my $blob = $1 if $html =~ /<script 
type="application\/ld\+json">(.+?)<\/script>/s;
  unless ($blob =~ /\w/) {
  print "No JSON-LD\n";
  exit 1;
  }
  
  my @entries = @{$json->{'@graph'}};
  Data::Dump::dump(@entries);
  
  
--------------------


------------------------------------------------------------------------
mrw's Profile: http://forums.slimdevices.com/member.php?userid=38299
View this thread: http://forums.slimdevices.com/showthread.php?t=109446

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to