Permalink
Browse files

the script parse the inp, gets a list of ids, and try to fire the res…

…pective perseus URI
  • Loading branch information...
mromanello committed Feb 6, 2012
1 parent 22fdb61 commit 1d25a6527d9c793dd15f9b110701c36a76d66312
Showing with 26 additions and 0 deletions.
  1. +26 −0 script.py
View
@@ -0,0 +1,26 @@
+import urllib
+import random
+
+def format_perseus_uri(i_string):
+ prefix = "http://data.perseus.org/people/smith:"
+ return "%s%s"%(prefix,i_string)
+
+def get(url):
+ print "...fetching <%s>"%url
+ return urllib.urlopen(url).read()
+
+try:
+ f = open("./bios.txt","r")
+ data = f.read().split("\n")
+ random.shuffle(data)
+ f.close()
+ print "There are %i Smith IDs in the input list..."%len(data)
+ print get(format_perseus_uri("caesar-1"))
+
+ for n in range(10):
+ print data[n]
+ test_url = format_perseus_uri(data[n])
+ print "<%s>"%get(test_url)
+
+except IOError:
+ print "this time didn't work"

0 comments on commit 1d25a65

Please sign in to comment.