← inews
Andreas Hartmann, 20.03.2008 09:49:
Can we create video ids also different for different shows?
Yes, but again not with built-in components of iNEWS. The idea behind this solution is the same as for the single video id script (see video-ids).
There are two strict limitations so far:
rundown
.At all you need a combination of a Linux shell script and a macro inside iNEWS.
So this solution take care about:
The specification which shows will get what video ids in what format with what special string is to setup inside the iNEWS system directory.
<show string><date>-<sequence number>
. The show string and date format are configurable. The sequence number runs from 001 up to 999.<rundown> <show string> <date format>
<rundown>
is the queue where video ids are assigned. Its parent folder must contain a hidden folder with a video-id queue inside. See next point how to create it.<show string>
is a string containing only characters A-Z, a-z and 0-9 and especially it must contain no spaces.<date format>
refers to the linux strftime format. Call man strftime
on the iNEWS server console to get more help.; This story must contain the list of all rundown queues. ; It is used by the linux script /site/scripts/video-ids/video-ids.sh. ; All rundowns must be named "RUNDOWN". ; There must be a HIDDEN.VIDEO-IDS queue in each show directory. ; Format of the entries is: ; <rundown> <show string> <date format> news.1800.rundown N18 %d%m%y news.2130.rundown N21 %d%m%y features.business.rundown FB %d%m%y
hidden
in each show directory (see previous point) inside iNEWS database.video-ids
.nobody
.!none
or the group which is allowed to assign video-ids./site/scripts/video-ids
/site/scripts/video-ids/data
/site/scripts
create a file yes2
with following content:y y
/site/scripts/video-ids
create a file video-ids.sh
with following content:#! /bin/bash # # Author: Andreas Hartmann # andreas@hmedia.de # # creates video-ids # runs every morning at (via crontab) # produces separate video id lists for different rundowns # takes the rundowns from a list inside iNEWS # # check www.hmedia.de/wiki for more information # # LISTQUEUE="system.rundowns" PROGRAMDIR="/site/scripts/video-ids" DATADIR="$PROGRAMDIR/data" LOGFILE=/var/log/messages LOGDATE=$(date | cut -c5-19) if /exc/ifis master then doc -gu $LISTQUEUE | sed --quiet -e 's/;.*//;s/[ \t][ \t]*/ /g;/^[^ \.][^ \.]*\.[^ ][^ ]* [A-Za-z0-9][A-Za-z0-9]* %/p' > "$DATADIR/list" for SHOW in $(cat "$DATADIR/list" | cut -f1 -d" " | rev | cut -f2 -d"." | rev) do ID=1 DIGIT=00 echo "" > $DATADIR/ids RUNDOWN="$(cat "$DATADIR/list" | grep $SHOW | cut -f1 -d" ")" if /exc/list q $RUNDOWN 2>&1 | grep "No directories or queues match" > /dev/null then echo "$LOGDATE localhost $(basename $0): ERROR: Can't create video IDs for $SHOW! $RUNDOWN is not a queue." >> $LOGFILE continue fi IDQUEUE="$(cat "$DATADIR/list" | grep $SHOW | cut -f1 -d" " | rev | cut -f2- -d"." | rev).hidden.video-ids" if /exc/list q $IDQUEUE 2>&1 | grep "No directories or queues match" > /dev/null then echo "$LOGDATE localhost $(basename $0): ERROR: Can't create video IDs for $SHOW! $IDQUEUE is not a queue." >> $LOGFILE continue fi CHANNELTAG="$(cat "$DATADIR/list" | grep $SHOW | cut -f2 -d" ")" SHOWTAG="$(cat "$DATADIR/list" | grep $SHOW | cut -f3 -d" ")" DATE="$(date +$(cat "$DATADIR/list" | grep $SHOW | cut -f4 -d" "))" /exc/dbpurge $IDQUEUE 0 < /site/scripts/yes2 > /dev/null while test $ID -le 999 do if test $ID -ge 10 then DIGIT="0" fi if test $ID -ge 100 then DIGIT="" fi echo "$CHANNELTAG$SHOWTAG$DATE-$DIGIT$ID" >> $DATADIR/ids ID=$(expr $ID + 1) done /exc/doc -pu $IDQUEUE $DATADIR/ids echo "$LOGDATE localhost $(basename $0): creating video IDs for $SHOW" >> $LOGFILE done fi
chmod 744 /site/scripts/video-ids/video-ids.sh
hidden.video-ids
queues, your script works properly. Also you should check the /var/log/messages file for some errors. To run the script type:/site/scripts/video-ids/video-ids.sh
35 5 * * * /site/scripts/video-ids/video-ids.sh > /dev/null 2&>1
The leading two parameters specify the time when the script has to run (in our case 05:35). See the man-page for more information. Type man crontab
to read this man-page. The last parameters after >
prevent some error messages to get printed. You should have an entry for video-ids.sh
in the crontab of each iNEWS server.
system.forms.t.type-q
{alt {right}{right}{left}}{alt wo}{end}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}hidden.video-ids{enter} {alt {right}{right}}{ctrl {home}}{shift {end}{left}}{ctrl x}{delete}{ctrl se}{alt wc}{alt vuf}type-q{enter}{home}{tab}{f2}{home}{ctrl v}{shift {end}}{ctrl x}{shift {home}}{ctrl v}{f2}{shift {tab}}{alt vun}{home}{tab}{tab}{tab}
German version:
{alt {right}{right}{left}}{alt fa}{end}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}hidden.video-ids{enter} {alt {right}{right}}{ctrl {home}}{shift {end}{left}}{ctrl x}{delete}{ctrl se}{alt fs}{alt abf}type-q{enter}{home}{tab}{f2}{home}{ctrl v}{shift {end}}{ctrl x}{shift {home}}{ctrl v}{f2}{shift {tab}}{alt abn}{home}{tab}{tab}{tab}
French version:
{alt {right}{right}{left}}{alt no}{end}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}{backspace}hidden.video-ids{enter} {alt {right}{right}}{ctrl {home}}{shift {end}{left}}{ctrl x}{delete}{ctrl se}{alt nf}{alt hum}type-q{enter}{home}{tab}{f2}{home}{ctrl v}{shift {end}}{ctrl x}{shift {home}}{ctrl v}{f2}{shift {tab}}{alt hun}{home}{tab}{tab}{tab}
Discussion