Parsing Sun Alerts

If you wanted to parse a Sun Alert to get meta data like its synopsis, product, state etc., here is something more than plain old regular expressions. It is a XSLT transform, that reads a Sun Alert html file and just prints the metadata in plain text format.

Use xsltproc(1) to process the Sun Alert this way:
$ /opt/csw/bin/xsltproc --html saplain.xsl 'http://sunsolve.sun.com/search/document.do?assetkey=1-26-102262-1' 2>/dev/null
Sun Alert ID: 102262
Synopsis: Security Vulnerability in sendmail(1M) Versions Prior to 8.13.6
Category: Security
Product: Solaris 9 Operating System, Solaris 10 Operating System, Solaris 8 Operating System
BugIDs: 6397275
Avoidance: Workaround
State: Workaround
Date Released: 22-Mar-2006
Date Closed:
Date Modified: 24-Mar-2006

The intent is to channel this metadata to an RSS feed, so those who prefer a RSS feed for Sun Alerts can get them that way. Watch this space for more to come.
Comments:

hello, just trying your command on my ultra20 (s10 3/06) and i got only errors: ultra20-henry% /opt/csw/bin/xsltproc --html saplain.xsl 'http://sunsolve.sun.com/search/document.do?assetkey=1-26-102262-1' 2 > /dev/null http://sunsolve.sun.com/search/document.do?assetkey=1-26-102262-1:114: HTML parser error : htmlParseEntityRef: no name seOut="javascript:closefly();"><div><a id="glink1" onclick="if(window.s_account& \^ http://sunsolve.sun.com/search/document.do?assetkey=1-26-102262-1:114: HTML parser error : htmlParseEntityRef: expecting ';' closefly();"><div><a id="glink1" onclick="if(window.s_account&&this.getAttribute

Posted by henry on March 27, 2006 at 03:21 AM PST #

Notice that am ignoring those errors by adding 2>/dev/null

you can also use printer (and bandwidth) friendly url: http://sunsolve.sun.com/search/printfriendly.do?assetkey=1-26-102262-1

Posted by Chandan on March 27, 2006 at 03:27 AM PST #

thanks for your reply. I'm using tcsh instead of bash, so "2>/dev/null" was uneffective.

Posted by henry on March 27, 2006 at 03:43 AM PST #

Post a Comment:
Comments are closed for this entry.
About


sayings of an hearer

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today