[link] 2005-03-17T22:51:10 Automatic display of incoming picture share: :0 c * ^Subject: A Picture Share! | $MAILDIR/pictureshare And this is in Mail/pictureshare: And this is scripts/newmozilla on dash: For testing, I run received mh mails through the program:
#!/usr/local/bin/python2.3
# if mail contains a link like this, launch mozilla on dash. part of
# the url will end up in a shell command, so i limit the url tightly.
# if there is not a good enough match, this program silently exits.
# <a style="color: #FF0000;" href="http://pictures.sprintpcs.com/share.jsp?invite=gEZm4LPf8UzcFaCLk8Zx&amp;shareName=Photo">View</a>
import sys,re,os
msg = sys.stdin.read()
m = re.search(r"""href="http://pictures\.sprintpcs\.com/share\.jsp\?invite=([a-zA-Z0-9]+)&amp;shareName=Photo">View""",msg)
if m:
remote_cmd = "DISPLAY=:0.0 scripts/newmozilla http://pictures.sprintpcs.com/share.jsp\?invite=%s\&amp;shareName=Photo" % m.group(1)
print "launching mozilla on dash for picture share email"
os.system('source ~/.ssh-agent-dot; ssh dash "%s"' % remote_cmd)#!/bin/zsh
URL=$1
if [[ $URL = "" ]]; then
URL=http://google.com
fi
/usr/local/mozilla/mozilla -remote "openurl($URL,new-window)"dot(pts/0):~% cat Mail/inbox/127 | Mail/pictureshare
launching mozilla on dash for picture share email
![]() | Unless otherwise noted, all content licensed by Drew Perttula under a Creative Commons License. |