在本地写一个txt的文件(比如:today.txt)。在cygwin命令行下:
$ blog today.txt
就可以发布today.txt到你的livespace和blogger博客。
需要安装:
* Cygwin+mutt+ssmtp
* blogger和live.space开启邮件发布博客功能
配置
~/.muttrc: mutt配置
set locale = zh_CN.gbk
set charset = gbk
# folders
set spoolfile = ~/Mail/spoolfile
set mbox_type = Maildir
set folder = ~/Mail
set mbox = "+inbox"
#set record = "+sent"
set postponed = "+outbox"
# ssmtp
set sendmail = "/usr/sbin/ssmtp.exe"
ssmtp配置: ssmtp-config,配置好后的~/.msmtprc
# Set default values for all following accounts.
defaults
tls on
logfile ~/.msmtp.log
# gmail
account gmail
host smtp.gmail.com
from your-name@gmail.com
auth on
user your-name@gmail.com
password your-password
port 587
# Set a default account
account default : gmail
脚本:blog。实现发布FILE到博客,FILE第一行为博客标题。
#!/usr/bin/bash
# Usage: blog [FILE]
linenum=`cat $1 | wc -l`
let linenum=linenum-1
tail -n $linenum $1 | mutt -s `head -n 1 $1` your-space-name.xxxxx@spaces.live.com your-space-name.xxxxx@blogger.com
没有评论:
发表评论