← inews
Andreas Hartmann, 25.05.2007 11:48:
Can we create video-ids automatically?
Yes, but not with built-in components of iNEWS. You need a combination of a Linux shell script and a macro inside iNEWS.
So this solution take care about:
hidden
in 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 # # creates video-ids # runs every morning at (via crontab) # if /exc/ifis master then LOGFILE=/var/log/messages LOGDATE=$(date | cut -c5-19) DATE=$(date +%Y-%m-%d) ID=1 DIGIT=00 /exc/dbpurge hidden.video-ids 0 < /site/scripts/yes2 > /dev/null rm /site/scripts/video-ids/data/ids while test $ID -le 300 do if test $ID -ge 10 then DIGIT="0" fi if test $ID -ge 100 then DIGIT="" fi echo "$(date +%d%m)-$DIGIT$ID" >> /site/scripts/video-ids/data/ids ID=$(expr $ID + 1) done /exc/doc -pu hidden.video-ids /site/scripts/video-ids/data/ids echo "$LOGDATE localhost $(basename $0): creating video IDs for $DATE" >> $LOGFILE fi
chmod 744 /site/scripts/video-ids/video-ids.sh
hidden.video-ids
queue, your script works properly. 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 wo}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt wc} {alt {right}{right}{left}} {alt vuf}type-q{enter} {home} {tab} {f2} {space}{backspace} {home} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt vun} {home} {tab}{tab}
German version:
{alt fa}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt fs} {alt {right}{right}{left}} {alt abf}type-q{enter} {home} {tab} {f2} {space}{backspace} {home} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt abn} {home} {tab}{tab}
French version:
{alt no}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt nf} {alt {right}{right}{left}} {alt hum}type-q{enter} {home} {tab} {f2} {space}{backspace} {home} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt hun} {home} {tab}{tab}
ddmm-xxx
whereas xxx
is a sequential number. This format can be easily changed or extended.tabs
. To avoid a disruption of its functionality by changing the rundown queue forms the macro works with its own queue view