add cookie support to head.py, for e.g. nytimes urls
parent
ecb8af1bbe
commit
18a24a8117
|
@ -7,11 +7,15 @@ Licensed under the Eiffel Forum License 2.
|
||||||
http://inamidst.com/phenny/
|
http://inamidst.com/phenny/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re, urllib, urllib2, httplib, urlparse, time
|
import re, urllib, urllib2, httplib, urlparse, time, cookielib
|
||||||
from htmlentitydefs import name2codepoint
|
from htmlentitydefs import name2codepoint
|
||||||
import web
|
import web
|
||||||
from tools import deprecated
|
from tools import deprecated
|
||||||
|
|
||||||
|
cj = cookielib.LWPCookieJar()
|
||||||
|
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
|
||||||
|
urllib2.install_opener(opener)
|
||||||
|
|
||||||
def head(phenny, input):
|
def head(phenny, input):
|
||||||
"""Provide HTTP HEAD information."""
|
"""Provide HTTP HEAD information."""
|
||||||
uri = input.group(2)
|
uri = input.group(2)
|
||||||
|
|
Loading…
Reference in New Issue