xhtmled v3.0
Posted on July 24, 2007 at 10:43 PM EST
After taking an over-extended blog hiatus of almost two years, I have finally returned to my home on the interweb. A few weeks ago I began working on new site for xhtmled and launched it last weekend.
Frontend
The previous version of my site, which has been archived at retro.xhtmled.com, received a lot of attention and was featured on several different CSS galleries. With this version, I decided to take a more minimalist approach by eliminating the sidebar and making it free from clutter.
I have always preferred using underscores “_” to dashes “-” because I think they make URIs easier to read, since they lie on the baseline and add more whitespace between each word. It has been proven that Google treats dashes as word separators and when the Googlebot reads underscores it will treat the entire string of words as one word. Therefore, I have gone against my personal preference and have switched to using dashes instead of underscores.
Backend
The site now runs almost entirely on SimpleLog, a content management system written in Ruby on Rails. I grew tired of using MovableType not too long after I began using it, but never got around to converting over to a different CMS.
Here are some of the reasons why I chose to use SimpleLog:
- Simplicity
- Just like the name suggests, it’s simple. MovableType has a lot of features that I never used that just got in the way. Simplelog has just the number of features that I need — nothing more, nothing less.
- Speed
- Another thing that I really could not stand about MovableType was having to rebuild to rebuild my pages. Now whenever a change is made to the database, it is reflected in real-time.
- Pages
- Having the ability to add new pages directly from the admin interface is just as easy as creating a new post.
- Markdown
- Support for Markdown is built into SimpleLog, which keeps HTML tags out of the textarea box in the admin section. This makes it much easier to read and write content. When an entry has been saved, Markdown immediately converts the marked-up text to well-formed XHTML.
Subversion
Subversion (also known as SVN) is an open-source version control system. It keeps track of each and every change that is made to your project. Once I’m satisfied with how everything looks on my local development site, I check the files into my Subversion repository. If you ever need to retrieve an older version of your work, it will allow you to easily rollback to a previous revision.
I prefer to store all of my repositories on a remote server. This way they are stored at an offsite location just in case anything were to ever happen to my local workstation and it also enables me to check out files on multiple computers.
Capistrano
Capistrano is a tool for automating the deployment of your web application to a server. It is also capable of doing much more, but this is what it is most commonly used for. After I’m finished checking my files into Subversion, I just need to enter a single command line in order to have the changes appear on my live site. No more FTP!
Feeds
The feed subscription link has changed from http://rss.xhtmled.com to http://www.xhtmled.com/rss so please be sure to update the link if you subscribe to it in your news aggregator.
On the Horizon
There are a few things that I plan on adding over the next few weeks, such as integration with my Flickr, del.icio.us, and Last.fm accounts.
I hope you like it and if you stumble upon any bugs please let me know.
There are 0 comments on this post. Post yours →
Tagged with rails, redesign, simplelog, site, subversion, webdev
Show Netflix Movies using PHP 5
Posted on August 30, 2005 at 12:02 PM EST
I wrote the following PHP script for use on the Netflix page that I recently added to my site. The script parses the RSS feeds that are available for my Movie Queue and Previously Viewed Movies using the URLs that Netflix provides for my account. It uses PHP 5’s new SimpleXML extension which really simplifies parsing XML documents by quickly extracting data. In order to accomplish the same results under PHP 4 a lot of code would have been needed.
<?php
// define feed urls
$queue_feed = 'http://rss.netflix.com/QueueRSS?id=ENTER-YOUR-ID-HERE'; // url to queue feed
$recent_activity_feed = 'http://rss.netflix.com/TrackingRSS?id=ENTER-YOUR-ID-HERE'; // url to the most recent rental activity feed
// function that parses the xml and converts it to a nice ordered list
function show_movies($file) {
$xml = simplexml_load_file($file);
echo "<ol>\n";
foreach ($xml->channel->item as $item) {
$link = $item->link;
$title = $item->title;
$title = preg_replace("[[0-9]+- |Shipped: |Received: ]", '', $title);
echo " <li><a href=\"$link\">$title</a></li>\n";
}
echo "</ol>\n\n";
}
echo "<h2>Movie Queue</h2>\n";
show_movies($queue_feed);
echo "<h2>Previously Viewed Movies</h2>\n";
show_movies($recent_activity_feed);
?>
In order to use the script your server will need to be running PHP 5. Just replace “ENTER-YOUR-ID-HERE” with your id number and you’re ready to go. You can get the id by logging into your Netflix account then clicking on the RSS link at the bottom of the page. The number can be found under the Personalized Feeds section and it starts after the = sign in the URL.
There are 0 comments on this post. Post yours →
Tagged with netflix, php, scripts, webdev
iChatStatusPublisher
Posted on August 09, 2004 at 11:15 PM EST
Description
iChatStatusPublisher is a stay-open script application that enables you to make your site more interactive by displaying your current iChat status. When you’re available, it will display a hyperlink that your visitors can click on to send you an instant message.
Requirements
- Mac OS X 10.1 or higher
- iChat AV
Installation
Download the script.
Create a new folder named “iChat” in your user’s Library folder (/Users/USERNAME/Library/iChat).
Open the Script Editor which is located in the AppleScript directory inside your system’s Applications folder (/Applications/AppleScript/Script Editor).
Copy and paste AppleScript code into the top box of the Script Editor.
Edit the config variables at the top of the script and enter the appropriate information. I recommend using the SCP option as it is a more secure method of transferring files. If your web host does not support connections via SSH then you’ll need to use FTP. In this case I recommend creating an additional FTP account that just has access to a sub-folder on your account to help minimize security risks.
-
Click “File” then “Save As…” and a dialog box will appear (see below).

Save the file as “iChatStatusPublisher” and save it to your system’s Applications folder.
Select “Application” from the File Format drop-down menu.
Check the option to “Stay Open”. This will keep the script running in the background so it can communicate with iChat.
Go to your Applications folder and double click on the icon for “iChatStatusPublisher” to run the script. You may also want to create an alias to the script and save it to your Desktop.
Copy the PHP code and paste it where you would like the iChat status to appear on your webpage. This file must be saved as a .php file. (If your page is currently saved as an .htm or .html file, please see the instructions below on how to get it working on your page.)
Edit the config variables at the top of the script and enter the appropriate information.
You should now be up and running! If you have any questions or problems, please post a comment below. Feedback is greatly appreciated!
SCP Transfers
SCP (Secure Copy) is an alternative to using FTP and is a more secure protocol. Much like SSH, it uses secure shell encryption to protect your information in transit. If you would like to transfer the data to your web server using SCP then follow the instructions listed below. If you’re not sure if support for SCP (SSH) is available to you, you’ll need to check with your web host to see if they support this feature. In order to transfer files via SCP, you’ll need to generate an SSH public/private key pair. These instructions assume that you don’t have any other keys present on your web server.
Open Terminal on your local computer and start a new shell session from the File menu.
Type “ssh-keygen -d”.
After entering the command, press the enter key three times.
Your public and private keys are now saved to “~/.ssh/id_dsa.pub” and “~/.ssh/id_dsa”.
Copy the key to your webserver by typing “scp ~/.ssh/id_dsa.pub yourdomain.com:.ssh/authorized_keys2”.
Enter the password for your account on the webserver when prompted then press the enter key.
Test the SSH key by typing “ssh yourdomain.com”. It should log you in without a password. If not, check to make sure you typed everything in correctly.
If you successfully connected to your account then you should be all ready to start uploading your iChat status file to your web server.
If Your Pages End in .html
If your pages end in .html there are two different methods that you can follow to get iChatStatusPublisher to work on your site. I recommend the first one even though the second method is easier and doesn’t require you to rename all of your pages. The second method can slow your server down a bit because PHP will have to parse your HTML when it may not need to. These instructions will only work if your website is hosted on a UNIX server.
Rename Your Pages to .php
Rename your pages from .html to .php.
Upload your .php files to your server and delete the .html files which will no longer be used.
Paste the PHP code below where you would like your iChat status to appear in your pages and be sure to change the config variables.
Upload your pages to your web server and you should now be able to view your iChat status.
Now create a new file and name it “.htaccess” without the quotes.
Copy and paste the four lines of code below into the file.
Upload the file to your root web directory (e.g. public_html). This will make it so any links that currently point to your .html pages will be redirected to the new .php pages.
# Redirect any links that point to .html extensions to .php
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.+).html$ $1.php [L]
Use PHP In Your .html Pages
Create a new file and name it “.htaccess” without the quotes.
Copy and paste the line of code below into the file.
Upload the file to your root web directory (e.g. public_html).
Your .html pages will now be parsed as PHP.
Paste the PHP code below where you would like your iChat status to appear in your pages and be sure to change the config variables.
Upload your pages to your web server and you should now be able to view iChat status.
AddType application/x-httpd-php .htm .html
Version History
v1.2 (August 11, 2004)
Added support for transfers via SCP.
v1.1 (August 9, 2004)
Initial release.
Disclaimer
THIS SOFTWARE IS PROVIDED AS-IS, WITHOUT WARRANTY OF ANY KIND. THE AUTHOR DISCLAIMS ANY DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS SOFTWARE.
THIS SOFTWARE IS COPYRIGHT © 2004 JEFF MILLER. YOU MAY USE AND/OR DISTRIBUTE THE SOFTWARE WITHOUT RESTRICTION.
Download
iChatStatusPublisher_1.2.sit
File Size: 4.42 KBs
Downloads: <%=
Net::HTTP.get('www.xhtmled.com', '/scripts/ichatstatuspublisher.php')
%>2,822
There are 16 comments on this post. Post yours →
Tagged with applescript, ichat, scripts, webdev
