this is ruby with the Hpricot gem.

gem install Hpricot

code:

require 'rubygems'
require 'hpricot'
require 'open-uri'

# fetch the overview
doc = Hpricot(open("https://wiki.edubuntu.org/CategoryEdubuntuSpec";))

# use only the class searchresults
result = doc/"div.searchresults"
(result/"a").each do |a|
   # hack instead of error handling.
   if not a.attributes['href'] == 
"/CategoryEdubuntuSpec?highlight=%28CategoryEdubuntuSpec%29" and not 
a.attributes['href'] == 
"/DedicatedLTSPSSH?highlight=%28CategoryEdubuntuSpec%29" and not 
a.attributes['href'] == 
"/EdubuntuCleanupEffort?highlight=%28CategoryEdubuntuSpec%29"
    puts a # print the link
    # open the linked document
    doc = Hpricot(open("https://wiki.edubuntu.org"; + 
a.attributes['href']))
    spec = doc/"a.interwiki" # interwiki is generated by 
UbuntuSpec:name-of-spec
    # open the spec
    doc = Hpricot(open( spec[0].attributes['href'] ))
    status = doc/"table.summary" # spec status is nicely held in summary 
table
    puts status
    puts "<BR /><BR />"
  end
end


-- 
edubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/edubuntu-devel

Reply via email to