Skip to content

Instantly share code, notes, and snippets.

Huyen Ha hathehuyen

Block or report user

Report or block hathehuyen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hathehuyen
hathehuyen / download.py
Last active Jun 12, 2017
Download url to file with buffered read and progress display
View download.py
#!/usr/bin/python
from urllib2 import urlopen
from datetime import datetime
from rfc822 import parsedate_tz
# Download url to file with buffered read and progress display
def download(url, file_name):
u = urlopen(url)
f = open(file_name, 'wb')
@hathehuyen
hathehuyen / check_last_modified.py
Last active Jun 12, 2017
Check last modified time of an url using Last-Modified header
View check_last_modified.py
#!/usr/bin/python
from urllib2 import urlopen
from datetime import datetime
from rfc822 import parsedate_tz
# Check last modified time of an url using Last-Modified header
def check_last_modified(url):
u = urlopen(url)
meta = u.info()
You can’t perform that action at this time.