Skip to content

Instantly share code, notes, and snippets.

View paulsavage's full-sized avatar
🏃‍♂️
Ready

Paul Savage paulsavage

🏃‍♂️
Ready
View GitHub Profile
@paulsavage
paulsavage / smarty
Last active November 28, 2017 16:44
Smarty replace UTF8 with ASCII
{set var=$find value=array ('™' ,'â','á','à','â','ã','ä','å','À','Á','Â','Ã','Ä','è','é','ê','ë','É','Ê','Ë','ì','í','î','ï','Ì','Í','Î','Ï','ò','ó','ô','õ','ö','Ò','Ó','Ô','Õ','Ö','ù','ú','û','ü','Ù','Ú','Û','Ü','ñ','Ñ','ß', 'æ' ,'ç','Ç','ÿ','ý','þ','Þ')}
{set var=$replace value=array('tm','a','a','a','a','a','a','a','A','A','A','A','A','e','e','e','e','E','E','E','i','i','i','i','I','I','I','I','o','o','o','o','o','O','O','O','O','O','u','u','u','u','U','U','U','U','n','N','ss','ae','c','C','y','y','p','p')}
{$thestring|replace:$find:$replace}

Keybase proof

I hereby claim:

  • I am paulsavage on github.
  • I am paulsavage (https://keybase.io/paulsavage) on keybase.
  • I have a public key whose fingerprint is B79D 586B 7CA2 A696 4F35 C985 23EF 6AFB ACD7 A58C

To claim this, I am signing this object:

Verifying that +paulsavage is my Bitcoin username. You can send me #bitcoin here: https://onename.io/paulsavage
from BeautifulSoup import BeautifulSoup
import urllib2
import urllib # really annoying - for urlencode
import cookielib
# read tracking page and fetch the signature DL page
def getDHLSig(ref):
# just wrap this in a try\except because it's 11pm and i'm sleepy
try:
url = "http://www.dhl.co.uk/content/gb/en/express/tracking.shtml?brand=DHL&AWB="+ref