Recently in How To Category
AOL, for some reason, released 2,000,000 search records taken from the last 3 months. With a tiny bit of programming, you can use PHP to search through these records. This post describes how.
But first, let's cut to the chase:
- Working example (expect "Internal Server Error" when under load)
- Source code
First, you need to download the files, which you'll have to find on your own, as I can't remember where I found them. The file is ~450MB.
wget http://whereverthosefilesare.com/AOL-data.tgz
Next, uncompress this file into its multiple parts:
tar zxvf AOL-data.tgz
Then, un-gzip the compressed files:
gzip -f user*.gz
This will leave you with a bunch of text files containing the actual log data. These files will be very large. So large in fact that your web server might not be able to deal with them in PHP. So, you should split them into multiple smaller files. For each .txt file, run a command such as:
csplit -f aol user*01.txt 1000 {1000} &
That code will split the files into multiple files of 1000 lines each, naming each them aol100, aol101 and so on. In these smaller chunks, PHP will be able to deal with them more easily. When I ran this command, I ended up with 2000 files of 1000 lines each. For the code below to work, each of these files must have the letters "aol" in their names.
Next, you can create a PHP page that will search the AOL log files for a certain string, and then return matching lines. The string you are looking for will be passed on the URL, as in http://example.com/search.php?search=sex
Here is the code for the PHP page.
Save the file as search.php or whatever, and then access it at its url, e.g., http://yourwebsite.com/search.php?search=thewordyouarelookingfor
Change the URL to run another search. You can take the user id from one search and put it on the URL, thereby finding all the searches by that user.
Google is complaining to the Department of Justice and the EU that Microsoft's forthcoming Internet Explorer 7 improperly encourages users to use MSN Search instead of a search engine of the user's choice. Google claims "research it has sponsored shows that it's difficult to change the settings in the new browser to a rival search engine."
I decided to do a little research of my own to see how "difficult" it is. Please watch this video:
[Sorry about using WMV. I hate it too.]
As you can see, it is a very simple 10-second process that most people could figure out without much effort.
I dislike IE and never use it, and I think Google is a great search engine, but it seems to me they are reaching a bit on this one. If it were me, I guess what I would ask is that Microsoft document how to create whatever kind of file it is that lets the toolbar's search feature use a given provider. They may have already done this -- I'm not sure. Update: Not only have they already done that, but the little plug-in or whatever you call it uses A9's OpenSearch format.
Ok, here's one for the masses.
This post describes how to add info about the song currently playing in iTunes to emails you compose in Outlook. Anyone can do it!
First, create the macro. To do so:
- Open Outlook.
- From the Tools menu, select Macro, then Macros...
- In the Macro field, enter a name for your macro. "AddiTunesSig" is probably appropriate. [screenshot]
- Click "Create".
- A "code window" will open. This is where, in a minute, you will type the code that makes up the macro.
- But first, you need to tell Outlook how to talk to iTunes. To do so, go to the Tools menu and select References. Scroll down until you find "iTunes Type Library" or something similar. Select its checkbox and click OK. [screenshot]
- Back in the code window, you will see two lines of code:
Sub AddiTunesSig()andEnd Sub. In between these lines, paste in the following code:' purpose: opens a new mail message, ' appends info re: currently playing track in iTunes Dim itunes As iTunesApp Dim strArtist As String Dim strTitle As String Dim strOutput As String Dim mail As Outlook.MailItem Set itunes = New iTunesApp 'load the track info into easy-to-read variables strArtist = itunes.CurrentTrack.Artist strTitle = itunes.CurrentTrack.Name strAlbum = itunes.CurrentTrack.Album 'assemble the signature strOutput = vbNewLine & "------------------------------" strOutput = strOutput & vbNewLine & "Now playing: " & vbCrLf _ & strTitle & vbCrLf & strArtist & vbCrLf & strAlbum 'create a new email message Set mail = Outlook.CreateItem(olMailItem) 'put the signature in the body mail.Body = vbNewLine & vbNewLine & strOutput 'show the message to the user mail.Display 'clear up the memory Set itunes = NothingSee how easy programming is! [screenshot]
- To finish up: Click the Save button on the toolbar and close the code window.
Now, you need to add a toolbar button to your Outlook toolbar that will run this macro. To do so:
- Go to the Tools menu, and select Customize...
- In the dialog box that pops up, scroll down the left side, and click Macros. [screenshot]
- You will see your macro on the right ("Project1.AddiTunesSig"). Drag it up to a convenient location on your toolbar. (Next to the "New" button is probably a good place.)
- To rename the button, right-click the button and type the new name where it says "Name:" in the pop-up menu. "New (with music)" is probably a good name. [screenshot]
- Close the Customize window.
That's it! To use it, open iTunes, play a song, go back to Outlook, and click your new button. A new email will open with info about the currently playing song in the signature area.
Earlier: How to control iTunes from any Microsoft Office application.
Let's say Sprint happened to to send you a free phone with a free service plan as part of their Ambassador program. Wouldn't you want to share the benefit of that service with as many people as possible? Especially if the plan included free data service? After all, Mr. Ambassador, you certainly want everyone to enjoy Sprint's quality service as much as you do, right?
Or let's say you're so rich you can afford to pay Sprint's (probably high) fees for unlimited data service. Since there's no additional cost to you, shouldn't you share some of that bandwidth with some of us poor saps who can't afford such luxuries?
This post describes how to use your Bluetooth- and Airport-enabled Mac with your Bluetooth-enabled Sprint PCS phone to set up a mobile wifi access point. Meaning, you can put your iBook in your car or backpack, put your phone in your pocket, and give free wifi internet access to anyone who happens to be in the area. (Of course, you will also be able to access the internet yourself all the while.)
These instructions assume you are using Mac OS X 10.4 (Tiger), and a Samsung A920, the official phone of Sprint Ambassadors everywhere. But they should apply to any Sprint phone with Bluetooth that is capable of being a data modem and/or using their Power Vision service. Non-ambassadors will have to navigate the labyrinth of Sprint customer service and get "phone-as-modem" service added to their plan. Once you've gotten that taken care of, please continue...
Summary for experienced people
Details are below, but if you know what you're doing and just want to do it quickly:
- Turn on Bluetooth on your phone.
- Pair your phone with your Mac.
- In the PPP configuration for Bluetooth in Network preferences, leave the username and password blank and use this phone number:
#777 - In Sharing preferences, go to the Internet pane and turn on Internet Connection Sharing for Bluetooth, allowing AirPort devices to connect.
- Back in PPP, click "Dial Now...". You should be all set. By default, your SSID will be your computer's name.
- If you need a detailed step-by-step, continue reading...
First, set up the phone
- Press "Menu/OK".
- Select "Settings".
- Scroll down and select "Bluetooth" and press OK.
- If Bluetooth is disabled, click OK on to enable it.
- Set "Visibility" to "Always visible". (This is optional and not very secure, but it might make things easier later.)
- Select "Device Name" and enter a nice name for your phone. This is the name other Bluetooth devices (like your Mac) will display when connecting to your phone. (I have found in other contexts that choosing a one-word name can reduce errors.)
Connect your Mac to your phone via Bluetooth
- Open System Preferences.
- In the Hardware section, click Bluetooth.
- In the Settings pane, make sure it says Bluetooth is on. Other than that, it doesn't matter much what is selected. [screenshot]
- In the Devices pane [screenshot], click "Setup New Device".
- The Bluetooth Setup Assistant wizard will start. Click "Continue" and select "Mobile phone" from the list of device types.
- The wizard will scan the airwaves looking for Bluetooth devices. When you see the name of your phone, select it and click "Continue".
- After a few seconds of "gathering information," the wizard will prompt you to click "Continue" to continue. Do so.
- Your computer will display a "passkey", a number you have to type into your phone to "pair" the phone with your Mac. [screenshot]
- Your phone will prompt you to accept the pair. Press "Accept".
- Enter the passkey into your phone and press OK. If you wait too long, the connection will time out, and you'll probably have to go back in the wizard and get a new passkey.
- Once the pairing has taken place, click "Continue" to continue.
- Make sure "Access the internet with your phone's data connection" is checked.
- Click "Continue".
- Here's the important part: You will be prompted to enter connection settings. Leave "Username" and "Password" blank. In "Phone Number", enter
#777. For "Modem Script", select "Sprint PCS Vision". [screenshot] - Optionally, select the checkboxes to show Bluetooth and Modem status in the menu bar.
- Click "Continue".
- Click "Quit".
Connect to the Internet
At this point, you might want to turn off Airport and/or unplug your network cable, so that when you connect to the internet via the phone, you'll be sure you are connected via the phone. (After it's all set up, you can turn Airport back on.) In the meantime, here's how to get connected:
- Open System Preferences. (Or click "Show All" if your Bluetooth panel is still active.)
- In the Network & Internet section, choose "Network".
- In the dropdown labeled "Show", select "Bluetooth".
- In the "PPP" pane, make sure "Account Name" and "Password" are blank, and that "Telephone Number" is
#777. - In the "Bluetooth Modem" pane, make sure the Modem dropdown says "Sprint PCS Vision", and (optionally) check all checkboxes. Now you're ready to connect to the internet.
- Go back to the "PPP" pane, and click "Dial Now..." An "Internet Connect" dialog box will appear. Make sure the Bluetooth pane is showing. [screenshot]
- Click "Connect". The modem status in the menu bar will read "Connecting..." and your phone will say "Connected as data modem to [your computer name]". You are connected! A timer on the phone will show the duration of your connection.
- Open a web browser on your computer to confirm that you are connected.
Share your internet connection via AirPort
Now you are ready to share your connection to the internet with other users. To do so:
- Turn AirPort back on if you turned it off earlier.
- Return to System Preferences. (Click "Show All" if you are still on your Network settings.)
- In "Internet & Network", click "Sharing".
- Go to "Internet" pane. [screenshot]
- In the dropdown labeled "Share your connection from", select "Bluetooth".
- In the "To computers using" area, select "AirPort".
- Click "AirPort options" to make sure encryption is not turned on and/or to change the name of the access point (SSID) that your Mac will broadcast .
- Click "Start" to start sharing your internet connection via wifi.
- You may get a message saying this conflicts with your firewall setting, as Personal Web Sharing must be turned on (for some reason) to share your internet connection. If there's a dialog, click "Show Services" or directly open the "Services" pane in Sharing (which partially controls your firewall), and activate "Personal Web Sharing" service. Note that this will make the "Sites" folder in your home directory available via your network connection. (If someone can explain to me why Personal Web Sharing has to be turned on in order to share your internet connection, I'd love to hear it. If it's just to open the port, couldn't they do that without firing up your web server?)
- That's it! You're connected and you're sharing your connection. You might want to test it with another wifi device to make sure it can connect. (By default, your Mac will broadcast its name as the the name of the access point (SSID)).
Potentially sad note: Some devices may not be able to obtain an IP address from your Mac, in which case they won't be able to use your connection to the internet. However, if you can talk to whoever is attempting to share your connection (e.g., you're over at your friends' house and want to get them online), you can configure their network connection manually. To do so, follow these instructions. I'd recommend keeping the IP addresses of some public DNS servers handy, so you can just type those in instead of trying to determine them from the dig utility or similar. I really don't know anything about Internet Connection Sharing on the Mac, so I have no idea which devices can automatically obtain an IP from it and which can't.
Added bonus: Note that if you look at the Personal Web Sharing preferences, you'll see your external IP has been resolved to an actual domain name like http://h460c83c6.area2.spcsdns.net. Anyone accessing that address in their browser will see whatever website your Mac is serving from its web server folders.
Keep in mind:
- Sprint PCS may or may not like the idea of you sharing your bandwidth. (Especially if you're not an Ambassador and don't have diplomatic immunity.)
- If you are at work or school, your network administrator may or may not like (1) your computer's new-found role as a DHCP server, and (2) your computer giving indirect access to his/her LAN.
Even so, at least you can go to bed knowing you are the Robin Hood of wireless bandwidth!
Last year, there was some coverage of a slow, but effective, technique to open a Master combination lock. If you don't need to save the lock and don't have time to go through the algorithm, you might want to just try opening it with a screwdriver, as shown in this video I made:
I'm not sure if this video just demonstrates the obvious -- I wasn't even sure it was worth a post -- but I thought I'd provide it just in case. I learned that this would work when I was about 12 years old, so it's not a very sophisticated approach.
The lock shown in the video is not a Master Lock, but the technique works with those, too. You might need something a little narrower to pry the dial up, and it takes a little longer, but it shouldn't take more than about 5 minutes. I don't know anything about locks, really. If I did, the video would probably be about 75 percent shorter. (You can see me poking at various irrelevant parts of the lock in the video.)
The best technique, in my opinion, is the shim. But if you don't have a shim, the screwdriver technique is not a bad option.
ps. the video is an an iPod-compatible mpeg4.
Summary
This post describes how to interact with and control iTunes from any Microsoft Office application in Windows. Specifically, it shows how to:
- Create an Excel spreadsheet that lists all the tracks in your iTunes library, organized by playlist
- Use an Access database to update the mp3 ID tags of your songs in iTunes
- Create a Microsoft Word document that lists all your iTunes tracks info in a table
- Control iTunes playback from any Office application
Downloads
If you don't want to read the boring explanation about how to do these things, and you just want to download the files that already do them, here you go:
- Excel spreadsheet that loads your iTunes library info and lets you play any selected song
- Access database that lets you browse your collection, update tags, and control playback
- Word document that displays all your iTunes tracks in a table
To use the Word and Excel files, run the macros in the Tools:Macro menu. Note that you will probably get all kinds of warnings about macro security and so on when you open the files, so you'll have to figure out how you want to handle that. Or you can also just get the source code from these text files, but you'll need to know how to connect that code to macros, etc. Please also note that these files are offered primarily as tutorials, not as complete applications, so they are likely to be buggy and not fail gracefully. Also, it's probably helpful to open iTunes before opening any of these documents. You can file bug reports in the comments, and I'll try to fix them when I'm able.
Technical Background
Many Windows applications, including iTunes, provide "libraries" of functionalities to other applications. Certains kinds of these libraries are called "COM objects", and they tend to be relatively easy to work with. Fortunately, Apple provides one of these for iTunes, and Visual Basic for Applications (VBA), the scripting language provided with Microsoft Office, can make use it. Using VBA, you can tap into the iTunes COM, and manipulate iTunes objects like playlists, tracks, and even the playback functionality. This post describes how to do so.
Getting Started
Interacting with the iTunes Library
Let's start by connecting a Word document to iTunes, so you can output a list of all the songs in your iTunes library to a Word document.
- Open iTunes.
- Open Word.
- From the Tools menu, select Macro, then Macros.
- Type the name of the macro you want to create ("Show_iTunes_Library" might be a good name), and click Create. A VBA editing window will appear. This is where you will type the code that will make up your macro.
- Before you can make VBA do anything with iTunes, you need to tell it where to find the library of iTunes functions it can use. From the Tools menu, select References... Go through the list until you find "iTunes 1.2 Type Library", check it, and click OK.
- Back in the VBA editing window, paste this text in between the first and last lines of your subroutine:
Dim iTunes As iTunesApp Dim tr As IITTrack Set iTunes = New iTunesApp For Each tr In iTunes.LibraryPlaylist.tracks ActiveDocument.Range.InsertAfter (tr.Name & vbCrLf) Next Set iTunes = Nothing - Let's take another look at that code and see what it all does:
'declare an object variable for the iTunes application and an iTunes "track" (song) Dim iTunes As iTunesApp Dim tr As IITTrack '"instantiate" the class, i.e., prepare it for use. Set iTunes = New iTunesApp 'go through each track in the LibraryPlaylist For Each tr In iTunes.LibraryPlaylist.tracks 'in the active document, insert the track's name (i.e., song title) 'and a new line (carriage return/line feed) ActiveDocument.Range.InsertAfter (tr.Name & vbCrLf) Next 'reset the iTunes object to free up the memory used in this code set iTunes = Nothing - Back in your Macros dialog box, click the name of the macro you just created and run it. It should output all the track info in your library to the active document in Word. (There is code in the Word document above that shows how to convert this data into a table automatically.)
This is just a basic example to show how to iterate your iTunes song library in VBA. If you wanted to have more info about each track appear, you can change the tr.Name part to include things like tr.Artist, tr.Album, tr.PlayedDate, etc. The VBA programming environment should display all the properties available to you as you start typing them. For example, if you declare tr as an iTunes track object, when you type tr., all the available properties and actions (aka "methods") will appear in a drop-down selection box text to the variable name.
Controlling iTunes Playback
Similarly, to make the iTunes application itself take certain actions, you can do thing like iTunes.Play or iTunes.Pause, assuming your code has an iTunesApp object called iTunes. The names of the available actions ("methods") will appear when you type the name of the object variable followed by a period.
For example, we can make a simple form in Microsoft Access that will control iTunes playback. This will probably go more smoothly if you've had a little experience designing forms in Access.
- Open iTunes.
- Open Microsoft Access,
- In the database window, choose Forms, and create a new form using Design View.
- Add two buttons to the form. Name one cmdPlay and one cmdPause.
- Set the captions to "Play" and "Pause" accordingly.
- In the properties for cmdPlay, go to the Events tab, and in the On Click property, click "..." to create a new subroutine that will run when the button is clicked.
- When the VBA window opens, set your references to the iTunes 1.2 Type Library as described above.
- In the subroutine for cmdPlay_Click, enter this code:
Dim iTunes As iTunesApp Set iTunes = New iTunesApp iTunes.Play Set iTunes = Nothing - Go back to your form, and in the Click event for cmdPause, create a new subroutine that looks like this:
Private Sub cmdPause_Click() Dim iTunes As iTunesApp Set iTunes = New iTunesApp iTunes.Pause Set iTunes = Nothing End Sub - Open your form in Form view, and click the Play button. It should work.
If you want more information on all the iTunes objects, properties, and methods available to you, check out Apple's iTunes Software Development Kit for Windows. You can pretty much ignore all of it except for the help file (iTunesCOM.chm) which, in a somewhat arcane manner, describes each of the classes (objects) and their properties and methods. Unfortunately, the help file is heavy on specification and light on examples, but using the examples and downloadable files I provided above, you should be able to figure it out with a bit of those critical thinking skills you picked up when you were younger.
Next Steps
Once you've figured out how to iterate through the tracks in your library, you are pretty much only limited by your knowledge of how VBA works in each of the Microsoft Office applications. If you know how to use VBA to create new documents, or worksheets, or slides, or address book contacts, or whatever, it's fairly simple to manipulate an iTunes library, playlist, or track to do whatever you want with the Office application of your choice. For example, the downloadable Excel spreadsheet offered above loops through all your playlists, creates a worksheet for each one, and adds the tracks from each playlist to the appropriate spreadsheet, along with the last played date and the play count. It will also play a track when you click on a track name and run the "play track" macro. The Access database provided above shows you track info for the currently playing song, allows you to jump to any song you type in, and lets you update the mp3 tags for the songs in your iTunes Library. The Word document enters all the tracks in your iTunes library into a table. Examine the source code to come up with your own projects, and have fun integrating Microsoft Office with iTunes.
This is fairly basic stuff and has probably been explained elsewhere, but I thought I'd quickly summarize for anyone who might be wondering how to do this. I was inspired by DiveIntoMark's tutorial on using a Windows PC to control a Mac. This process is pretty similar, but I'm going to show how to do it Mac-to-Mac using slightly different software and techniques. This is great if you're like me, and you gave your mom a Mac and occasionally need to help her troubleshoot something. It's also good if you want to control your home computer from work.
Background
Using technology semi-generically called VNC (Virtual Network Computing), you can control one computer from another, even if you're on a Mac and want to control a Windows pc or a Linux box, or vice versa. This is sometimes called using "Remote Desktop." With VNC, you have a "VNC server", i.e., the computer you are connecting to and controlling (your mom's) , and the "VNC client," the computer you are sitting in front of and doing the controlling with (yours).
Recommended Software
You can accomplish this using a variety of software packages, but for ease of use, I recommend:
- Apple Remote Desktop Client. A bit of a misnomer as far as I can tell. This package actually contains the VNC server software you need. This should be installed on the computer you want to control. It is installed by default on Mac OS X 10.4 (Tiger), but if you don't have it, you can download it for free.
- Chicken of the VNC. A great VNC client. This should be on the computer you want to use to control the other computer.
- That's it.
Steps
On the VNC server
- Configure the router at the location of the VNC server to forward all traffic on port 22 (SSH) to the VNC server. The methods for each router vary. If you don't know how to do it, just search Google or your router's documentation for "port forwarding."
- In the System Preferences panel of the VNC server (the computer you want to control), click Sharing. In the Services panel, check "Remote Login" (aka SSH) and "Apple Remote Desktop".
- Click "Start" to start each service if they aren't already running.
- For "Apple Remote Desktop," click "Configure" and make sure "Observe" and "Control" are checked. Also, it's smart to check "Guests may request permission to control screen" and enter a password for this function.
- Determine the external IP address of the VNC server. The easiest way to do this is probably to go to the always useful whatismyip.com. Or just check your router settings.
On the VNC client
- On the VNC client, make sure any VNC server software is turned off. (In other words, go into the Sharing control panel on your machine and make sure Apple Remote Desktop is not checked.) This is because if the client machine is running a VNC server, it will clog up port 5900 and you won't be able to connect to the desired VNC server. (I learned this the hard way.)
-
To set up a secure connection between your computer (the VNC client) and the other computer, open the Terminal application on your Mac (Applications/Utilities/Terminal.app) and type
wheressh yourusernameontheserver@vnc.server.ip.address -L 5900:127.0.0.1:5900yourusernameontheserveris a valid username on the VNC server, and thevnc.server.ip.addressis the external IP address of the VNC server. For example, to connect to the machine 100.100.100.1 on which you had the usernametrobots, you would type:ssh trobots@100.100.100.1 -L 5900:127.0.0.1:5900. This command will connect you to the VNC server and redirect all traffic on the VNC client port to the server's VNC port, through the secure (encrypted) tunnel that SSH establishes. - Open Chicken Of The VNC on the client computer.
-
In the "Host" textbox, type
localhost:5900and click "Connect." Your VNC client will try to connect to "localhost" (your computer) on port 5900 but all that traffic will just get sent right out through the SSH tunnel, which goes straight to the VNC server. Pretty cool. - After some delays related to encrypting all that traffic going back and forth between your computer and the VNC server, you should see an image of the other computer's screen on your screen. Moving your cursor will move the cursor on the VNC server's screen. It will respond slowly, but you can now control the other computer. Anyone on the other end will be able to see everything happening on the VNC server's screen.
- When you are ready to logout, close Chicken of the VNC, and go back into Terminal and end your SSH session by typing "exit".
Note: When you are done, I recommend stopping the Remote Login service on the VNC server. It's just one checkbox in the Sharing preferences panel, and it will secure the computer. Teach your mom or whoever to turn that service on and off so that it's only activated when you need it to be. If want to leave the Remote Login service turned on all the time, you should come up with some strong passwords, or use a more secure technique that relies on public and private keys rather than passwords. (See "Resources" below.)
Resources
-
A more complicated method of doing this using a "reverse" SSH tunnel.
- DiveIntoMark's PC-to-Mac VNC tutorial. Describes using public/private keys instead of passwords.
Thanks to Mike at manyhighways for helping out.
You may recall I half-wrote a script to do this a couple years ago, but I was mostly cribbing from some guy at Apple and really had no idea what i was doing.
Anyway, I'm taking another shot at parsing the iTunes library XML using PHP5's new "SimpleXML" library, which is a terrific feature that I never get tired of working with.
I cooked up this little script in about 10 minutes. The format of Apple's XML files makes it sort of a pain to process in the usual ways, but you can still get reasonable output with just a few lines of code. And most of that code is concerned with formatting, not the actual XML processing.
To use this script:
- Make sure you are using PHP5 with SimpleXML support. At Dreamhost, you can turn this on by clicking the "edit" link on the main domain management page. If you're hosting a site on your Mac, you can get an easy-to-install version of PHP5.
- In iTunes, select a Playlist or Library, choose "File:Export..." and export it as XML. Name it itunes.xml. (If your site is hosted on your Mac, you can just create a symlink called "itunes.xml" that points to your "iTunes Music Library.xml" file or the playlist file you just exported. Place this link in your website directory.)
- Upload itunes.phps and itunes.xml to your webserver.
- Rename itunes.phps to itunes.php.
- Open your browser and navigate to itunes.php.
Obviously there are lots of ways to enhance the functionality of this script, but this will get you started.
I was interested in using PHP5's DOM extension to create RSS feeds, but I couldn't find a decent tutorial on the web about how to do that. Most of the things out there involve PHP4's DOM-XML, which is different in some key ways. Even PHP.net lacks basic examples of how to use even the most fundamental DOM methods.
So I puzzled my way through it, using the sparse examples at PHP.net and the old DOM-XML samples for creating generic XML docs, trying to find the matching methods in the current DOM reference.
Once you've figured out how to create and append one node, the rest is pretty easy. So here is a sample feed generated by PHP and DOM, and here is the heavily commented source code that produces it.
This script demonstrates how to use DOM to create an RSS feed from items that are manually entered into an array. It's pretty easy to adapt the code to use a database to automatically enter those items into an array: all you'd have to do is query the database, add your items to an array, and substitute that array for the one manually generated in my script. (For the sake of completeness, I will post a script that does this when I get a few minutes.) Update: You can see an example of this fully automatic technique in this Ning app I created.
My webhost, Dreamhost, whom I recommend, allows you pretty comprehensive control over your server space and shell account, even on shared servers. They even let you compile and customize your own installation of PHP. Since PHP5 offers a bunch of useful features absent from PHP4, but DH is currently running only PHP4, I decided to make the migration.
This post explains how to install PHP5 on a Dreamhost server, but is probably useful for anyone attempting to install it in any shared hosting environment.
I've prepared detailed instructions on migrating your mail messages from Microsoft Outlook to Mozilla Thunderbird.
I am not an expert on Mozilla software or mail clients, but I do have a lot of experience with software, and went through this process several times before getting it to work the way I wanted. The steps below are not mandatory for success and may not be the most efficient method, but if followed, they should bring you success.
Note that there is a very easy way of migrating your messages: Just open Outlook, and from the File menu, choose "Export..." Choose to export to a file, and then choose the file type ".pst". After you install Thunderbird, just import the messages from this .pst file. This post is so long because it discusses customizing the migration process, and putting the mailboxes in a location where they can be easily backed up.
For me, the greatest benefit of performing the migration this way -- besides the actual switch itself -- is that it makes backing up and restoring your email much easier than it would be with Outlook. All you have to do is burn one directory to a CD, and you know you have everything. I never had confidence that would work with Outlook.
I performed the migration using Thunderbird 0.7.3 with Windows 2000 Professional and Outlook 2002, so YMMV.
Here are the directions:


