Offline WordPress released
I finally got around to releasing my script I use for toting my private WordPress notebook around on my iPod. It’s essentially a PHP page that creates a static HTML page with a load of JavaScript to selectively hide and show posts as they’re searched for.
This is my method for getting the resulting file onto my iPod. I’ve included it here in case it’s useful to someone.
Things you will need
- A jailbroken iPod/iPhone
- MobileTerminal (from Cydia)
- wget (from Cydia)
- file:// Schema in Safari (from Cydia)
Setting up the alias
Open MobileTerminal and type the following:
iPod:~ mobile$ nano .bashrc
This will either open your existing .bashrc file or create one for you in Nano.
The following command will create an alias that makes a backup of your previously downloaded export page and then downloads the latest version.
alias wp='cd; mv export.html export~.html; wget http://www.domain.com/pathtopage --output-document=export.html'
Note that if your blog is behind a password you will need to add --http-user=name and --http-password=pass to the wget part of the alias.
Now close the file by typing CTRL-O.
To make sure your .bashrc file loads when you start up your iPod you now need to create a .profile. Type the following:
iPod:~ mobile$ nano .profile
Then add the following to that file:
source $HOME/.bashrc
Close the file by typing CTRL-O.
Now any time you want to download your WP data just load up MobileTerminal and type wp. To load your offline page in Safari you need go to the URL file:///var/mobile/export.html.