Showing posts with label a13. Create a Portal for Your Memory Stick Files. Show all posts
Showing posts with label a13. Create a Portal for Your Memory Stick Files. Show all posts

Wednesday, March 9, 2011

The Code for Portal Creation

Download "memoryportal.php" in http://ifile.it/b3a8mq1
Type this code into your text editor of choice and save it as make_index.pl. Place this file in the root directory of your PSP's Memory Stick, either by dragging it there or executing one of the following commands:

Unix, Mac OS X, Linux
cp make_index.pl /Volumes/Untitled

Windows
xcopy make_index.pl F:\

If your Memory Stick has a name other than Untitled, Mac OS X users should use the appropriate directory name. If you are on Windows, choose the drive letter (F:, in these examples) that your PSP was assigned. If you are on Linux, be sure to replace /Volumes/Untitled with the mount point of your PSP.

To run the script, you must run the following command from the command line.

In Mac OS X, use the Terminal (located in /Applications/Utilities/) and run the following commands:

cd /Volumes/Untitled
perl make_index.pl

These are the same commands you will use in UNIX/Linux.

In Windows, open a command prompt and run:

F:
cd \
perl make_index.pl

Once the script begins running, you will be prompted for your del.icio.us username. If you enter nothing, this step will be skipped. After the command has completed running, you can navigate to the root level of your Memory Stick and you will see a newly created index.html file. Double-click on this file to launch it in your computer's web browser and inspect the results of the code.

Once you have this script created, you can run it every time your PSP is connected to your computer to update the index.html file.

On your PSP, make sure that you bookmark file:/index.html in the browser, so that you can easily navigate to this index of all of your photos, text files stored in the Notes folder, and your del.icio.us bookmarks tagged with PSP. Consider making it your home page.

Installing Dependencies for Portal Creation

This script uses PerlMagick and cURL to work its magic. Since Perl is included in most modern systems, there are only a few bits that you need to make sure are in place before beginning.

Windows
If you are on Windows, first make sure you have Perl installed (we suggest ActivePerl, which you can get from http://www.activestate.com). Next, grab PerlMagick, which is part of the ImageMagick package available under the Windows Binary Release section of the ImageMagick site (http://www.imagemagick.org/script/binary-releases.php). Next, install cURL from http://curl.haxx.se/download.html and put the executable in your PATH. C:\Windows will work, but we suggest you add an entry to your PATH and put it there. If you choose the version of cURL with SSL support, you may need to install additional libraries. This script does not require SSL support.

Mac OS X
If you are on Mac OS X, you need to install ImageMagick. Download the source of ImageMagick (http://www.imagemagick.org/script/install-source.php). Extract the source, and then from the Terminal (which is located in /Applications/Utilities/), type the following commands:

cd ImageMagick-
./configure && make
sudo make install

Each line is a separate command. Enter the first command, then hit return and wait while a bunch of text flies by in the Terminal window. This will build ImageMagick from the source. If the string of text comes up with any errors at the end after the second command, then try running the command again with sudo at the beginning. After the third command, when sudo is invoked you will be asked for a password (and possibly a warning, if this is the first time you invoke sudo). Enter the Administrator password for your computer.

After ImageMagick successfully compiles, you may need to compile Perl-Magick, if it was not compiled automatically. Enter the following commands to build PerlMagick (the PerlMagick directory is a subdirectory of the ImageMagick- directory):

cd PerlMagick
perl Makefile.PL
sudo make install


Again, if there are any errors in step two, try invoking sudo at the beginning of the command.

Make sure you check the installation documentation that accompanies ImageMagick (in particular, the README and INSTALL files), since you may need some other programs that ImageMagick depends on. For example, on Mac OS X, we needed to install libjpeg (see http://www.ijg.org/) from the source tarball (jpegsrc.v6b.tar.gz), using the following commands:

tar xvfz jpegsrc.v6b.tar.gz
cd jpeg-6b/
./configure && make
sudo make install
sudo make install-lib
sudo ranlib /usr/local/lib/libjpeg.a


UNIX/Linux
Make sure that you have PerlMagick installed. This should be available in your Linux distributions package repository. If not, you can follow the Mac OS X instructions to compile it from source. You will also need cURL.

Friday, March 4, 2011

Creating a Portal for Your Memory Stick Files

Why not keep a directory of all the local images and text files on your Version 2.0 PSP in HTML format, for easy access via the browser? Better yet: why not automate the process with Perl and automatically grab all of your psp-tagged del.icio.us bookmarks in there to boot?

Well, you have a PSP with Version 2.0 or later of the firmware, so you don't have all the great homebrew emulators available for the earlier versions. However, unless you downgrade from Version 2.0, you are making do by loading every JavaScript-capable game or program you can find onto your Memory Stick and converting all your documents to text files for viewing via the nifty little browser that Sony included with Version 2.0 of the firmware.

Let's really trick out your PSP by putting together a Perl script that will run on Windows, Mac OS X, or Linux, with only a few dependencies. This script will automatically scrape the photos contained in your Memory Stick's /PSP/PHOTO/ folder, scrape any text files contained in /PSP/NOTES/, optionally grab any links on your del.icio.us (http://del.icio.us) account that are tagged with "psp," and build an index.html file linking to all these files and located at the root directory of your Memory Stick.