Input programs using wire as an example.

Introduction

The wire program is used in this course as a way of describing all the major input programs. Each program works in a very similar fashion, but you should check the program's individual documentation for exact switches.

See: wire, vwire, pwire, zwire, smtpwire.

In general the object of an input program is to receive a file, map its metadata to a fip header and leave it in a directory for further fip processing. Almost always this directory is "2brouted", which is monitored by iproute which can make routing decisions based on the incoming metadata.

Wire

The ‘wire’ program receives data when it is transmitted in either an ANPA (American Newspapers Publishers Association) or IPTC (International Press Telecommunications Council) format.

By default the program is set to ‘recognise’ IPTC formatted wires, but has to be instructed if the format is ANPA (-a).

Typically the ‘wire’ program is pointed at a physical port (-p) on a terminal server (-s), which in turn is connected serially to either a modem or a PC, where the data is actually received.

The standard ‘wire’ program syntax looks something like:-

apds   ws   wire -s 192.168.100.1 -p 4011 -a –t -n APDS
where:-
   apds   Unique process name
   ws   Group name
   wire   Program name (/fip/bin)
   -s   Device name (terminal server)
   -p   Physical port number
   -n   Service name (saved as the SU header field)
   -a   Transmitted data will be in ANPA
   -t   Do not delete the story trailer (i.e. the wire agency time stamp)

For further switches please see Wire Program documentation

The ANPA Format

A. Start of message header – all transmissions will start with SYN (synchronous idle) SYN SOH (start of header) or octal \026 \026 \001.

B. Service level designator – a single alphabetic character that identifies the basic nature of the service e.g. f = financial, s = sports, z = z-wire.

C. Story number – four numeric characters e.g. 4432.

D. End of field delimiter – octal \037.

E. Selector code – five character field of lower case alphabetic and hyphen characters which provides a unique identity of the transmission e.g. knigv.

F. End of field delimiter – octal \012 (new line)

G. Priority – designated by a single alphabetic character e.g. f (flash), b (bulletin), u (urgent), r (rush), d (daily), w (weekday advance), s (weekend advance).

H. End of field delimiter – octal \040 (space)

I. Category code – a single alphabetic character e.g. a (domestic), d (food), e (entertainment), f (financial), i (international), o (weather), r (racing), s (sports), t (travel).

J. Format identifier – two non-printable characters which describes the sort of material being transmitted. The first character will be a DC3 (device control - octal \023) for body type (8 point type) or a DC4 (octal \024) for agate (5.5 point type). The second character will be a DC1 (octal \021) for text or a DC2 (octal \022) if the item contains any tabular lines.

K. End of field delimiter – octal \040 (space)

L. Keyword – a maximum of 24 upper or lower case characters which identify the story cycle and the story name. All words in the keyword will be joined by hyphens and it cannot contain any space characters e.g. BC-DEMS-KERRY-EDWARDS.

M. End of field delimiter – octal \040 (space)

N. Version – describes new leads, inserts, corrections, adds etc. e.g. sub-pickup9thgraf.

O. End of field delimiter – octal \040 (space)

P. Reference field – is a reference to a previous transmission number.

Q. End of field delimiter – octal \040 (space)

R. Date – displayed in the form MM-DD e.g. 07-30.

S. End of field delimiter – octal \040 (space)

T. Word Count – an estimate of the number of words created by taking the number of characters and dividing by 6. It is displayed as a four digit number e.g. 0492.

U. End of field delimiter – carriage return (\015) and a line feed (\012).

V. Start of text – a single character STX (octal \002) defines the start of the story.

W. Text –

X. End of text – a single character ETX (octal \003) defines the end of text.

Y. Time and date – this is the time and date the story was transmitted e.g. AP-ES-07-30-04 0953EDT

Z. End of transmission – a single character EOT (octal \004).

-Raw wire story example-


\026 \026 \001 a0561 \037 ----- \n
r \s p \023 \021 \s BC-CVN-ConventionRdp \s 5thLd-Writethru \s \s \s 07-30 \s 0999 \r\n
\002 ^BC-CVN-Convention Rdp, 5th Ld-Writethru,920\r\n
^Kerry, Edwards embark on cross-country 'let's make it happen' bus
campaign<
^Eds: INSERTS two grafs after 13th graf, 'Aides said,' to UPDATE
with Bush spokesman comment; picks up 14th graf previous, 'The
Democrats ...'<
……………………
\003 AP-ES-07-30-04 \s 0953EDT<\r \n \r \n \f \r \n \004

How this maps to a Fip Header

The ‘wire’ program breaks apart the incoming stream of data and creates a FIP data file. The story header (between the SOH and the STX characters) is stored in the FIP header? field SH (source header) and the text of the file (between the STX and the ETX characters) becomes the body portion of the FIP file. If the ‘wire’ program is run with the –t switch (save the story trailer), this also becomes part of the body of the FIP data file.

The file that the ‘wire’ program creates is stored in the directory /fip/spool/2brouted and would look something like:-

~
SU:APDS
ST:wire
SF:anpa
SP: 192.168.100.1,4011
SC:ascii
DF:wire
ZI:
#HS:wire_4011_2004-8-3_02:04:35_2_215
HD:03
HM:08
HY:2004
HI:Aug
HH:02
HN:04
HB:35
HJ:215
HG:+0400
HW:2
HL:1091495075|3ce320
HF:20040803010435+0100
SH::Sa:N0561:L-----:Pr:Cp:F31:KBC-CVN-ConventionRdp:V5thLd-Writethru:R D:07-30:W0999
SN:a0561
~
^BC-CVN-Convention Rdp, 5th Ld-Writethru,920\r\n
^Kerry, Edwards embark on cross-country 'let's make it happen' bus
campaign<
^Eds: INSERTS two grafs after 13th graf, 'Aides said,' to UPDATE
with Bush spokesman comment; picks up 14th graf previous, 'The
Democrats ...'<
……………………
\003AP-ES-07-30-04 0953EDT<
\004

Source Header Field One of the most important things about this file is the SH (source header) header field. It comprises all the information the ‘wire’ program received between the SOH (octal \001) and STX (octal \002) characters.

Each piece of information is preceded with a single uppercase letter and separated from the next by a colon character. Therefore the value of the service level designator follows the :S, the sequence number comes after the :N, the priority after the :P and so on.

These pieces of information are used to form virtual FIP header fields all of which start with the letter X. The second letter of the FIP header field is the upper case character immediately after the colon, therefore the service level designator is the XS field, the sequence number is XN, the priority XP, the selector code XL and so on. Source header virtual fields

XS (service level designator) = a
XN (sequence number) = 0561
XL (selector code) = -----
XP (priority) = r
XC (category code) = p
XF (format identifier) = 31
XK (keyword) = BC-CVN-ConventionRdp
XV (version) = 5thLd-Writethru
XR (reference field) = 
XD (date) = 07-30
XW (number of words) = 0999
These virtual fields are most often used for working out a files route and also for filling in a pre-assigned header when the file is delivered on to a remote server or an editorial system.

Links

see also wire program documentation.

Notes and Comments

Topic revision: r2 - 17 Mar 2005 - 12:22:09 - DotFingerPost?
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback