Skip to content
This repository was archived by the owner on Dec 25, 2020. It is now read-only.

Conversation

@wonsper
Copy link

@wonsper wonsper commented Nov 22, 2010

auto convert http://a1.phobos.apple.com/us/r1000/abcd links to image tags

def applepic(value):
imgs = re.findall('(http://a1.phobos.apple.com/us/r1000/[a-zA-Z0-9\.\-\_\/]+.jpg)\s?', value)
if (len(imgs) > 0):
for img in imgs:
img_id = re.findall('http://a1.phobos.apple.com/us/r1000/([a-zA-Z0-9\.\-\_\/]+).jpg', img)
if (img_id[0] != 'demo' and img_id[0] != 'whatever'):
value = value.replace('http://a1.phobos.apple.com/us/r1000/' + img_id[0] + '.jpg', '')
return value
else:
return value
register.filter(applepic)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant