The Human Glowstick
For my wonderful coworker Jason Scott:
Here is how to use python and lxml to parse web pages with unicode characters, encoded as utf-8. It would be nice if lxml.html.parse(url)
could correctly use the Content-Type HTTP header, but it doesn’t, so you have to tell lxml what encoding to use.
>>> import lxml.etree >>> url = 'http://hi.wikipedia.org/wiki/मुखपृष्ठ' #utf-8 encoded bytes >>> url 'http://hi.wikipedia.org/wiki/\xe0\xa4\xae\xe0\xa5\x81\xe0\xa4\x96\xe0\xa4\xaa\xe0\xa5\x83\xe0\xa4\xb7\xe0\xa5\x8d\xe0\xa4\xa0' >>> utf8_html_parser = lxml.etree.HTMLParser(encoding='utf-8') >>> page = lxml.etree.parse(url, parser=utf8_html_parser) >>> print page.find('head/title').text विकिपीडिया >>> page.find('head/title').text u'\u0935\u093f\u0915\u093f\u092a\u0940\u0921\u093f\u092f\u093e' |
http://www.spur.org/publications/library/article/carnegie-libraries-san-francisco
Internet Archive received a large book donation from Friends of the San Francisco Public Library:
http://blog.archive.org/2011/09/20/volunteer-help-us-get-200000-books-on-sunday/
This is what it looked like before the books were packed up:
Hi Raj
Amazing work.
I’m in the process of building an online library of Tamil works and Brewster and Archive.org have been a huge inspiration. We are also planning on using the BookReader, so special thanks to you are in order .
(My blog rajrecords.wordpress.com displayes the BookReader links for all featured books for easier reading).
All the best
Ramesh Chakrapani
Singapore
I found two great dev tools today:
$ gem install vagrant $ vagrant box add base http://files.vagrantup.com/lucid32.box $ vagrant init $ vagrant up |
Also, today I learned enough about Open Library to draw an architecture diagram.
http://www.publishers.org/main/PressCenter/Archicves/2011_March/January2011StatsPressRelease.htm
Every week I choose one book title and post four covers from different countries.
Via MeFi Projects
Volume 9 of the Popular Mechanics DIY Encyclopedia (1955) has a section on how to fabricate your own A.C. relays.. Just look at that guy making a relay with a hammer! I love how the section of building relays is thrown in with the sections for repairing your roof and fixing your refrigerator, as if this was a common task for the 1950’s homeowner.
Available to borrow from Open Library’s Lending Library program!
Reply