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

add apple picture support #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add apple picture support #11

wants to merge 1 commit into from

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