Syncing Websites to Your Palm for Offline Reading

Want to support HowtoForge? Become a subscriber!
 
Submitted by rene (Contact Author) (Forums) on Sat, 2006-04-01 05:25. :: Other

Syncing Websites to Your Palm for Offline Reading 

Version 1.0

Author: Rene Cunningham <rene@compounddata.com>

This is a brief tutorial on how to sync websites to your palm for offline reading. The websites are stored in Plucker format. You will need to install the Plucker viewer for palm which can be found at the Plucker website. The software you will use to grab the websites and convert them into Plucker format is called Sunrise. To transfer the Plucker files to a Palm you will need pilot-link.

NOTES:

  • All references to the directory ~ points to your home directory which is also $HOME.
  • Commands within this document are identified with a $ at the start of the line.
  • You do not need root access to your machine in order to get this HOWTO to work for you.

1. Install the Software

I tend not to install software globally on my system unless its using some sort of package management such as DPKG or RPM because any libraries, config files and binaries are easy to upgrade and remove. Ive included instruction on how i install Sunrise and Java locally.

Download and install the latest version of Sunrise from the following SourceForge project.

http://sourceforge.net/project/showfiles.php?group_id=151061

To install Sunrise locally for your current user using the tarball provided follow the instructions below. Make sure you save the Sunrise tarball file in your ~/tmp directory

$ mkdir -p ~/local/share
$ tar zxvf ~/tmp/sunrise-0.42j.tar.gz -C ~/local/share/

As of Sunrise version 0.42j you will need at least Java 1.4.2. If you dont have Java install download it from

http://www.java.com/en/download/index.jsp

To install java locally for your current user using the tarball provided follow the instructions below. Make sure you save the .bin java install file in your ~/tmp directory.

$ mkdir -p ~/local/share/
$ cd ~/tmp/
$ sh jre-1_5_0_06-linux-i586.bin
$ mv jre1.5.0_06 ~/local/share

Then add to your ~/.bash_profile

export JAVA_HOME=~/local/share/jre1.5.0_06
pilot-link appears to be supported by all major distributions so you should be able to use your distributions package management tools to install pilot-link.

2. Configure Sunrise

Sunrise needs to point to a working version of java. If you havent configured $JAVA_HOME properly you can point sunrise to our newest version of $JAVA_HOME that we downloaded.

Edit ~/local/share/sunrise-0.42j/sunrise-desktop.sh to look like

#!/bin/sh
JAVA_HOME=~/local/share/jre1.5.0_06
SUNRISE_HOME=~/local/share/sunrise-0.42j
pushd $SUNRISE_HOME
$JAVA_HOME/bin/java -Xmx128m -Djava.library.path=. -jar sunrise-desktop.jar
popd

Please make sure JAVA_HOME points to a working Java directory.

Make sunrise-desktop.sh executable and then run it

$ chmod a+x ~/local/share/sunrise-0.42j/sunrise-desktop.sh
$ ~/local/share/sunrise-0.42j/sunrise-desktop.sh

Create a 'New Item' by going to File->New Item Wizard. Make sure you choose a Directory (in this case ill be using ~/media/sunrise) to store our files locally. Once you have added an Item you need to add Documents to our new Item.

To add a document go to File->New Document. Fill in a website details. Dont forget to fill in URL/File.

3. Transfer Plucker Documents to a Palm

Once Sunrise has finished downloading and converting the websites you can transfer the Plucker files to your palm using pilot-xfer which is found within the pilot-link suite of tools.

$ pilot-xfer -p net: -i ~/media/sunrise/*.pdb

~/media/sunrise/ is the path i configured Sunrise to store my downloaded websites.

4. Sync Sunrise

Sunrise can be run from a console instead of the GUI. I find this perfect for automatically syncing the websites i want downloaded.

Within your ~/local/share/sunrise-0.42j directory create the file sunrise-cl.sh

#!/bin/sh
JAVA_HOME=~/local/share/jre1.5.0_06/
SUNRISE_HOME=~/local/share/sunrise-0.42j
pushd $SUNRISE_HOME
$JAVA_HOME/bin/java -Xmx128m -Djava.library.path=. -jar sunrisecl.jar $*
popd
Make the file executable

$ chmod a+x ~/local/share/sunrise-0.42j/sunrise-cl.sh

You should have a .sdl file within the directory you configured Sunrise to store the download websites into. In my case the file is located at ~/media/sunrise/main.sdl. You need to pass this file to sunrise-cl.sh as an argument. Running this command will sync all my websites that ive selected to download.

$ ~/local/share/sunrise-0.42j/sunrise-cl.sh ~/media/sunrise/main.sdl

By creating a cron job within /etc/cron.daily/ that looks something like the following, Sunrise will sync every day.

#!/bin/sh
# Sync sunrise documents

JAVA_HOME=~rene/local/share/jre1.5.0_06
MAIN_SDL=~rene/media/sunrise/main.sdl

# exit if main.sdl doesnt exist
[ -f ${MAIN_SDL} ] || exit

# exit if we are already running sunrise
if $(ps auxww|grep -q java|grep -q sunrisecl);then
    exit
fi

# are we online? if so update sunrise thanks
if $(ping -c 3 yahoo.com >/dev/null); then
    su - rene -c "
   ~/local/share/sunrise-0.42j/sunrise-cl.sh  ${MAIN_SDL}
    "
fi

5. Conclusion

Being able to read websites offline on my Palm has certainly made my life more productive. With plucker on my palm coupled with podcasts i now do not need to sit down at my desk and briefly go through a dozen websites to keep up to date with the latest news. I can do it whilst walking the dog, on a train or sitting at a cafe.

Any comments, questions, flames or free beer can be emailed to rene@compounddata.com

All speling misteaks and gramma erras are copirighted to me.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Sun, 2006-04-30 19:10.
There is software for PocketPC which supports plucker files.