In 2011 & 2012 I used Perl to read the programs broadcast by the Channel 4 of the BBC, on a particular day.I analysed this using excel functions having opened a ‘workbook’ with the argument ‘(“$url_file")’.
I have tried to do this today, for the first time after at least 6 years, but found that this did not work.
The Perl below shows the problem.You can see that the web site defined for variable $fund_url is the schedule simply by using this address in a web browser.getstore fails by returning a value of 501.The code is
use strict "vars";
use LWP::Simple;
my ($epg_dir, $fund_url, $fund_item, $url_file, $store_res);
$epg_dir = "C:\\evoke-recordings\\epg_files";
if(-d $epg_dir) {
print "epg file <$epg_dir> is there\n";
} else {
print "epg file <$epg_dir> is NOT there\n";
}
$fund_url = "http://www.bbc.co.uk/radio4/programmes/schedules/fm/2015
+/10/13";
print "\nfund_url <$fund_url>\n";
$fund_item = "2015_10_13_epg";
print "\nfund_item <$fund_item>\n";
$url_file = $epg_dir . '\\' . $fund_item . ".html";
print "\nurl_file <$url_file>\n";
$store_res = getstore($fund_url, $url_file);
print "\nstore_res <$store_res>\n";
The output from this
epg file <C:\evoke-recordings\epg_files> is there
fund_url <http://www.bbc.co.uk/radio4/programmes/schedules/fm/2015/10/13>
fund_item <2015_10_13_epg>
url_file <C:\evoke-recordings\epg_files\2015_10_13_epg.html>
store_res <501>
Can any Monk explain how I can make this work again?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.