Main:
Home

Installer:
Windows Install
OSX (Dropflux)
Linux HOWTO

Documentation:
Forums
Main Docs
Command Index
Main POD
Efficiency
Module Docs
ChangeLog
TODO List
FAQ

Tutorials:
First Tutorial
Second Tutorial

Perl Modules:
WWW::URLToys
LWP::TkIO

Scripts:
Console - Modular
Console - Standalone
GUI Downloader

Extra Utils:
XTTitle for Unix
XTTitle for Win32

Contact:
Contact Me

Scripts
Tutorial

wget.u
notepad.u
jolene.u
indexes.u

Logos









 
  [Change Log]
Installing URLToys in Linux: Introduction

Here's my first stab at talking to the one audience I haven't packaged URLToys on a silver platter for: Linux users. As a Debian user myself (my primary machine runs Debian/unstable), I suppose I figure many of you have already got it figured out. I'd almost expect people to go "Umm, its a Perl script. Sorry Joe, we've known how to install these for a while now." Either way, for the newcomers to Linux perhaps, this will help setup a typical Linux installation into the land of URLToys.

Don't be scared away by the length of this guide, I just talk a lot. If you want a summary of all of the commands, you can click here, but you'll miss out on my neverending wit, and perhaps a smarter way to install URLToys.



Step 1: Requirements

There are more than a few approaches to installing URLToys in Linux, but let's just make the list plain and simple to start with, then we can decide how we want to make these all available:

- The WWW Library for Perl ("LWP", or libwww)
- The Perl module Term::ReadLine, and any libraries that it utilizes
- Tk for Perl (only if you want the GUI downloader)
- LWP::TkIO (only if you want the GUI downloader)

These items should be sufficient to get your box ready for URLToys. This can be installed a million ways, but most of them depend on your distribution. I'll list the way to install these in Debian (since that is what I use), and then I'll list the generic way to install it. Users of other distros of Linux can email me with the distro-specific way they install it, and I'll add it to this page.

Requirements Option D: The Debian Way

[as root, type]:

apt-get install libwww-perl libterm-readline-gnu-perl perl-tk

It'll install some stuff, and when its done, you're ready for the TkIO step (if you're going to use the GUI).

[Contributed distro-specific installs will be put here]

Requirements Option "Generic": The CPAN Way

If you're a Linux user that has ever had to deal with Perl on anything but a super-trivial level, you've probably used CPAN at least once to install something for Perl. Here are the commands you should type to install the required modules (as root):

perl -MCPAN -e 'install "LWP"'
perl -MCPAN -e 'install "Term::ReadLine"'
perl -MCPAN -e 'install "Tk"'
[ <-- Optional, for GUI downloader only ]

If this is the first time you've ever tried this, CPAN will ask you a million questions. Most of them are OK with the defaults (just hit enter to skip past them), but you will have to explain where you are geographically and pick some servers to download from. Other than that, it should be pretty straightforward.

Installing LWP::TkIO (For GUI users only)

Download TkIO.pm. Choose a directory that Perl looks in for Perl modules... you can find out what directories Perl looks in with this:

perl -e 'print "$_\n" for @INC;'

Create a directory named LWP in there, then place TkIO.pm inside of the new LWP directory. That should be it!



Installing the URLToys Perl Module

Since version 1.26, URLToys has been modularized and placed into CPAN. This allows for people much smarter than me to write programs that utilize the URLToys commandset in ways I haven't thought of yet. As with before, there are a few ways to install the URLToys module (WWW::URLToys), so we'll go through both.

URLToys Perl Module Install, CPAN Style:

Just as before, become root and type:

perl -MCPAN -e 'install "WWW::URLToys"'

It'll ask a question or two, then drop back to the prompt.

URLToys Perl Module Install, Manual style:

First, download the URLToys.pm file. This is the actual module itself. All we have to do now is place it where Perl knows where to look for it. How do we find out where Perl looks? Here's one way:

perl -e 'print "$_\n" for @INC;'

That should list a handful of directories on your machine. This is the list (in order) in which Perl looks for a Perl Module when a script is run. Choose any one of these directories, become root, and create a WWW directory inside it. Then just copy the URLToys.pm inside of that WWW directory you just created. That should do it just fine.



Installing the Commands, Initial Configuration

Download urltoys. Download urltoysw, if you want the GUI downloader. Set the execute bit on them (chmod +x urltoys && chmod +x urltoysw), and move them somewhere in your PATH (I usually put them in /usr/local/bin). You'll have to be root to put them into /usr/local/bin. If all goes well, you should be able to just type in urltoys at any prompt and see the good ol' URLToys prompt. You did it!

Now, a quick, optional configuration. If you plan to run URLToys from the command line solely, you can skip this step, but URLToys will always try to save to the directory you are in when you run the command. Choose a location on your machine where you'd like URLToys to consider its place to download files to. For example's sake, let's say you choose /home/joe/downloads. Run URLToys and do the following:
URLToys (0)> set DownloadDir=/home/joe/downloads
URLToys (0)> config save
Saving Configuration...
URLToys (0)> exit
A few things have happened here. First off, you've told URLToys that you want it to change into this directory upon running the script, And secondly, you've created the ~/.urltoys directory. That is where URLToys script files can go.



The GUI downloader and Browser Configuration

"There are many ways to do this." -- Getting tired of me saying that? Ok, the way I setup my machine to download flux directly from a browser and into the GUI downloader is using the standard mime.types/mailcap files. For those that are unaware, many distros have a file named /etc/mime-types that has a list of MIME types and their associated extensions. They also have a file named /etc/mailcap that lists MIME types and programs that run them. These files are global to all users, and have matching user-based counterparts in your HOME directory (~/.mime-types and ~/.mailcap). Edit these files and add the following lines:

In ~/.mime-types:

Application/x-urltoysflux FLUX ua flux

And in ~/.mailcap:

Application/x-urltoysflux; /usr/local/bin/urltoysl '%s'

Change these as necessary. The command that is being run here is urltoysl, and is basically a launcher script that runs URLToys however you please. You should save that into /usr/local/bin and chmod +x it, just like the others. Now run your favorite browser, and try to click on a flux file [Here's a test flux]. Hopefully it should run as expected!



Quick Summary:

For those antsy in the pantsy to get started, here's a summary of all of the generic commands used to install URLToys. Modify at your leisure.

su
[type in root password if prompted]

perl -MCPAN -e 'install "LWP"'
perl -MCPAN -e 'install "Term::ReadLine"'
perl -MCPAN -e 'install "Tk"'
perl -MCPAN -e 'install "WWW::URLToys"'

cd `perl -e 'print shift @INC;'`
mkdir LWP
cd LWP
wget urltoys.com/TkIO.pm

cd /usr/local/bin

wget urltoys.com/urltoys
wget urltoys.com/urltoysw
wget urltoys.com/urltoysl

chmod +x urltoys
chmod +x urltoysw
chmod +x urltoysl


exit
[You should no longer be root]

echo "Application/x-urltoysflux       FLUX ua flux" >> ~/.mime-types
echo "Application/x-urltoysflux; /usr/local/bin/urltoysl '%s'" >> ~/.mailcap


Note: This doesn't account for the distro-specific commands listed earlier.

That's it! Have fun with URLToys, and send in those distro-specific Requirements commands.

Written by Joe Drago, Copyright (C) 2004, Under the BSD License