xmllint --xpath '//programme[ type = "Film" ]' raw/bleb-XML/0/$channelName.xml | tr -d '\n' | sed -re "s/<\/programme>/\n/gi"
ls -1 | cat -n | sed -re "s/\s+([0-9]+)\s+([^.]+).+/insert into channel values(\1,'\2','+');/gi" | sqlite3 ../../../database/tv.db
for i in $(seq 0 6)
do
getDaysProgramming $i
done
function getDaysProgramming() {
dayNo=$1
for channel in $(sqlite3 database/tv.db "select id,name from channel;")
do
channelId=( $(echo $channel | cut -d '|' -f1) )
channelName=( $(echo $channel | cut -d '|' -f2) )
echo $channelName $channelId
programmeDate=$(xmllint --xpath '//channel/@date' raw/bleb-XML/$dayNo/$channelName.xml)
programmeDate=$( getDate $programmeDate)
...
IFS=$'\n';
for programme in $(xmllint --xpath '//programme[ type = "Film" ]' raw/bleb-XML/$dayNo/$channelName.xml | tr -d '\n' | sed -re "s/<\/programme>/\n/gi")
do
echo "[-- $programme --]"
title=$( getTagValue $programme "title" )
startTime=$( getTagValue $programme "start" )
endTime=$( getTagValue $programme "end" )
year=$( getTagValue $programme "year" )
description=$( getTagValue $programme "desc" )
startTime=$(getTime $startTime)
endTime=$(getTime $endTime)
title=$(safeEntities $title)
description=$(safeEntities $description)
set +e
if [[ -z "${year// }" ]]
then
year=$(getDeepYear $description)
echo "=====================recovered deep year [$year]"
fi
set -e
echo "insert into programme select null,$channelId,'$title','','','$year','','','','true','','','','','','','','','','$description','','$programmeDate','$startTime','$endTime',0;" | sqlite3 database/tv.db
done
unset IFS
function getTagValue() {
raw=$1
tag=$2
echo $raw | egrep -q ".*<$tag>.+<\/$tag>.*"
if [ $? -eq 0 ]
then
echo $raw | sed -re "s/.*<$tag>(.+)<\/$tag>.*/\1/gi"
else
echo ""
fi
}
function getDeepYear() {
raw=$1
echo $raw | grep -Po '\d{4}(?!.*\d{4})'
}
http://www.bleb.org/tv/data/listings?days=...&format=...&channels=...&file=
http://www.bleb.org/tv/data/listings?days=0..6&format=bleb&channels=bbc1,bbc2,ch4,five,bbc1_hd,bbc3,bbc4,bbc_hd,boomerang,bravo,cartoon_network,cbbc,cbeebies,ch4_hd,dave,e4,film_four,five_us,fiver,itv1_hd,more4,nick_junior,nickelodeon,tcm,tmf,uk_gold,watch,yesterday
curl --user-agent "TVDIG::MEANINGFUL-INDENTIFIER-EMAIL-URL-ETC" -o raw/tv.tbz2 "http://www.bleb.org/tv/data/listings?days=0..6&format=bleb&channels=bbc1,bbc2,ch4,five,bbc1_hd,bbc3,bbc4,bbc_hd,boomerang,bravo,cartoon_network,cbbc,cbeebies,ch4_hd,dave,e4,film_four,five_us,fiver,itv1_hd,more4,nick_junior,nickelodeon,tcm,tmf,uk_gold,watch,yesterday&file=tbz2"
pushd raw
tar xf tv.tbz2
popd
raw/bleb-XML
raw/bleb-XML/0
raw/bleb-XML/1
raw/bleb-XML/2
raw/bleb-XML/3
raw/bleb-XML/4
raw/bleb-XML/5
raw/bleb-XML/6
bbc1.xml boomerang.xml ch4_hd.xml five_us.xml tcm.xml
bbc1_hd.xml cartoon_network.xml dave.xml fiver.xml tmf.xml
bbc2.xml cbbc.xml e4.xml itv1_hd.xml uk_gold.xml
bbc4.xml cbeebies.xml film_four.xml more4.xml watch.xml
bbc_hd.xml ch4.xml five.xml nickelodeon.xml
+++++++++++++++++++++++++++++++++++++++++
| !! MAIL BOUNCE !! |
+++++++++++++++++++++++++++++++++++++++++
| ERROR: 404 |
| SYSTEM: X504.mailsubsystem |
| MESSAGE ID: 0008 |
| DETAILS: |
| Your message has not been delivered |
| to the intended recipient. |
+++++++++++++++++++++++++++++++++++++++++
Automated message please do not respond.
Please check your spelling and try again.
common miss-spellings include
jumpstations.co.uk
jumpstation.com
jumpnation.com
jumpfactory.co.uk
jumpstation.fm
Automated message please do not respond.
email
root
flog archives
Disclaimer:
This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk
I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk
In fact I'm not responsible for anything ever, so there!