#!/bin/env python # # you can also use the script directly from gnuplot and even not saving it # # python get_spiacs.py '2011-07-31T11:08:30.0 30' # # gnuplot> plot "< python get_spiacs.py '2011-07-31T11:08:30.0 30'" u 2:3 # # gnuplot> plot "< curl http://isdc.unige.ch/~savchenk/spiacs-online/get_spiacs.py | python - '2011-07-31T11:08:30.0 30'" u 2:3 # from urllib2 import urlopen from urllib import urlencode import sys import re utc=sys.argv[1] resp=urlopen("http://isdc.unige.ch/~savchenk/spiacs-online/spiacs.pl",urlencode({"requeststring": utc,'submit':"Submit", 'generate':'ipnlc'})).read() print re.sub("^(\n|.)*result:","",re.sub("
","\n",resp),re.S) #print re.sub("^(\n|.)*result:","",re.sub("#.*?\n","",re.sub("
","\n",resp),re.M),re.S)