Archive for April, 2010
WordPress full export script
Add the script to crontab so that backup scheduled everyday.
Python code follows.
#!/usr/bin/python
import cookielib, urllib2, urllib, sys
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
def export(url, login, passwd):
u = "wp-login.php"
l = {"log":login, "pwd":passwd}
r = urllib2.Request(url + "wp-login.php", urllib.urlencode(l))
v = urllib2.urlopen(r).read()
r = urllib2.Request(url+"wp-admin/export.php?author=all&download=true");
v = urllib2.urlopen(r).read()
return v
def main(argv):
if len(argv)<4:
sys.stderr.write("Usage: %s http://your.wordpress.com/ user pass\n" % (argv[0]))
else:
print export(argv[1], argv[2], argv[3])
if __name__ == "__main__":
sys.exit(main(sys.argv))
AdBlock plugin for OmniWeb
Current OmniWeb has an ad-block feature, and this plugin makes it possible to automatically update the filter list from EasyList and etc.
Install SIMBL if not yet.
Download, unzip and copy Safari AdBlock.bundle to /Library/Application Support/SIMBL/Plugins/
For OmniWeb 5.x users, run following commands in Terminal to activate Safari AdBlock for OmniWeb:
defaults write -app OmniWeb ABIsEnabled -int 1
defaults write -app OmniWeb ABSubscriptions -array -string en
defaults write -app OmniWeb OWAddressFilteringEnabled -int 1
- works for Safari & Webkit too
- no preference UI in OmniWeb, turn on/off by using built-in AdBlock switch of OW
- built-in ad block of OmniWeb still works, use that as customized block list if you wish
- only tested on OSX 10.6.3 / OW 5.10.2-r128512, might also be ok for earlier versions though