w3mail

program to send a web page by email
git clone https://logand.com/git/w3mail.git/
Log | Files | Refs | README | LICENSE

commit dcdf1dde3cdd9b74fa041c35303f92c891e3026d
parent 98abdf81d2683dcda7b9b9fa3f8c58f061f88c26
Author: Tomas Hlavaty <tom@logand.com>
Date:   Wed, 17 Nov 2010 22:44:41 +0100

README added

Diffstat:
AREADME | 126+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 126 insertions(+), 0 deletions(-)

diff --git a/README b/README @@ -0,0 +1,126 @@ +w3mail +====== + +Written by Tomas Hlavaty <tom-at-logand.com> in 2010. + +Introduction +============ + +w3mail is a program that sends a web page by email. + +There are many ways of browsing the Web. In most cases, I prefer +using my email reader for managing web pages I read. No excessive +amount of open tabs in my web browser, smaller memory usage, better +readibility and powerful management of unread and read web pages, +their marking, expiry and deletion. It's asynchronous and the actual +reading takes minimum keystrokes and no aiming with mouse at all. I'm +also using the excelent org-mode http://orgmode.org/ on daily basis +and my email reader Gnus is very well integrated with it. + + http://lwn.net/Articles/262570/ + + To look at page I send mail to a demon which runs wget and mails + the page back to me. It is very efficient use of my time, but + it is slow in real time. -- rms + +Dependencies +============ + +Linux only. + +Runtime depends on: wget, md5sum, sendmail (mailutils). + +Build depends on: git, gcc. + +Download +======== + +Clone the git repository: + + $ git clone http://logand.com/git/w3mail.git + +Building +======== + +Switch to the new directory and make the w3mail executable: + + $ cd w3mail + $ make + +Invocation from shell +===================== + +1) Create w3mail script in your ~/bin directory. + +2) Paste the following text into the created file ~/bin/w3mail + +--- start of ~/bin/w3mail --- +#!/bin/sh +SENDMAIL='ssh username@host.name -e none /usr/lib/sendmail -t' +FROM='email@address' +TO=$FROM +HOST='host.name' +$HOME/git/w3mail/w3mail "$SENDMAIL" "$FROM" "$TO" "$HOST" "$1" +--- end of ~/bin/w3mail --- + +This script defines some configuration parameters that are specific to +my set up. Change the user name, host name and email address to suit +your needs. You could define SENDMAIL='sendmail -t' if you have +sendmail installed locally. In my case, I use ssh to my server and +invoke sendmail there. + +3) Set executable permissions: + + $ chown +x ~/bin/w3mail + +4) Use it + + a) Send single web page: + + $ ~/bin/w3mail 'http://logand.com/' + + b) Send many web pages: + + First save the URLs into a file, one URL per line. Then run: + + $ cat file | xargs -n1 ~/bin/w3mail + +Using w3mail with Emacs +======================= + +Put the following emacs-lisp code into your ~/.emacs file: + +--- begin cut--- +(defun w3mail (url &optional new-window) + (interactive (browse-url-interactive-arg "URL: ")) + (shell-command (format "~/bin/w3mail '%s' &" (browse-url-encode-url url)))) + +(defun w3m-w3mail (url) + (interactive (list (w3m-input-url nil nil nil nil 'feeling-lucky))) + (when (and (stringp url) + (not (interactive-p))) + (setq url (w3m-canonicalize-url url))) + (set-text-properties 0 (length url) nil url) + (setq url (w3m-uri-replace url)) + (unless (or (w3m-url-local-p url) + (string-match "\\`about:" url)) + (w3m-string-match-url-components url) + (setq url (concat + (w3m-url-transfer-encode-string + (substring url 0 (match-beginning 8)) + (or w3m-current-coding-system + w3m-default-coding-system)) + (if (match-beginning 8) + (concat "#" (match-string 9 url)) + "")))) + (w3mail url)) + +(global-set-key [f5] 'w3m-w3mail) +--- end cut --- + +Pressing f5 key will ask for the URL of the web page to be send. + +Feedback +======== + +Please send me an email.