Tag: programming

UPDATE: TV.com (which I use to find the show titles) has since changed their format, so I cannot guarantee that this script works as advertised. I will confirm it in the near future.
UPDATE 2: This Applescript has been replaced by a more efficient and lightweight Bash script.

After picking up a 750 GB hard drive for my Airport Extreme, I’ve started to rip my DVDs so that I can watch them on my computer. The problem is that the files don’t come out with descriptive episode titles, leaving you guessing when you want to pick a show to watch. If you decide to add the titles yourself, the process can be tedious and time consuming, not to mention downright annoying.

That is why I’ve created a combination Automator/Applescript workflow to do the job automatically. After entering the name of the TV show you’re looking for, the program takes the selected files and searches TV.com’s vast episode guide for the correct titles. Once the data has been collected, the titles are added to the selected files. The only preparation you must do is rename the files in the format SxxExx where S is the season number, and E is the episode number (S02E05, for example). This step is very easy when you use a program like NameMangler, which can add sequential filenames in one pass.

Download

Get TV Titles Application Download and run as standard application
Get TV Titles Workflow Automator workflow that can be saved as an application or Finder plugin
Get TV Titles Finder Plugin Can be run from the Finder contextual menu (right-click). To install, download and save to the folder Userfolder/Workflows/Applications/Finder.

Instructions

  1. Collect files and rename them in the SxxExx format. Using NameMangler seems to work best, but there are other applications out there to do the same thing.
  2. Select all the files you wish to add titles to.
  3. Start the program in whichever way you’ve downloaded: directly from Automator, the standalone application, or by the contextual right-click menu and navigating to More > Automator > Get TV Titles.
  4. Type in the name of the TV show you’re looking for episodes from.
  5. If you’re running it via the contextual menu, you’ll see this status message in the Finder menubar.
  6. Once the computer has processed the data, you’ll see all the episodes neatly named.

So far I’ve been able to edit more than 20 files at once. Of course, your mileage may vary, so please comment with feedback and results.

Tagged with: , , ,


I mentioned in an earlier post that I moved webhosts. It’s now been more than a month since that move was made, and I have already seen the benefits. By sharing what I’ve learned in my transition, I hope to enlighten other hopeful web users who are about to start their own site.

I moved from webserve.ca to Bluehost.com in June of 2008. The reason for the move was that I became annoyed with webserve’s downtime, and relatively basic feature list compared to other hosts. While their support was generally quick and responsive, the fact that I needed to put in so many requests was unacceptable.


Now that I’ve moved to Bluehost, I’ve noticed that Google response times are down, meaning the bandwidth for my site has been greatly improved. A faster server means more visitors, which is always a good thing.

If you’re in the market for a new webhost (or your first) here are some things to look for:

Bandwidth


This shows the difference that a good web host can make. The graph represents the average time Google needs to download a webpage. The drop is when I moved to Bluehost.

Bandwidth when related to web service means not only how much data your site allows you to transfer in a given month, but also at any given time. A higher number is always better, because most hosts institute large penalties for going over this number. The problem is that bandwidth often varies widely month to month, as sometimes a single link on a popular site like Digg.com can cause massive bandwidth spikes in mere hours. If the bandwidth link to your site isn’t large enough, an influx in traffic can cripple it. Unfortunately, you won’t truly know how well your site is connected until you receive one of these influxes.

Disk storage

In an age where portable hard drives have hundreds of GB and cost ~$100, don’t settle for less. A large data limit means you can store your own data outside your website for transfer, and also use advanced features on your own site (like a photo gallery). In many cases you won’t actually use your entire quotient, but it is good to have the excess if you ever want to expand.

Server hardware

This is important, but is often not a limiting factor. Simply put, a faster server system can handle more connections at once. This means that on a hosting plan with a fast server and good bandwidth, events like the Digg effect can almost be completely avoided. Usually hosts use the fastest hardware available, but some of the lower priced services achieve their savings with slower machines.

FTP and email accounts

With my original web service, I was only given 1 FTP account, without an option to configure more. At the time I had no real need to have more, but now that I have the ability to create an unlimited number of users and email addresses, I’ve learned how handy it can be. With multiple accounts, you can give friends or family access to a specific folder on your server with stored pictures, or any other large files that cannot be emailed. It’s the same way with email; you want the option to make more addresses than you originally think.

Multiple domains

The internet moves fast. While you may start with a single website, within months you could find an entire new niche with real potential. With the ability to host multiple domains with single hosting packages, you can get started much easier with a brand new website: simply buy a new domain, point it to your current package, and you’re good to go. Just keep in mind that you are also sharing resources, so if any of your sites become very popular, it is definitely worth while to switch to a dedicated package for that website.

Online configuration

The online configuration of a webhosting package is where you do all the administration tasks like adding email accounts, MySQL databases, and backing up your data. It should be intuitive and uncluttered. Unfortunately not many hosts give you the opportunity to try this panel before purchasing, so you’ll have to do some online research to learn about them. If things like MySQL databases make your head spin, be sure to look for hosting packages with step-by-step instructions to install popular features.

Server software

Mostly the domain of a website administrator, the server software decides what your website can do, and how reliable it is. A poorly managed server can be unstable, and cause more downtime than truly necessary. Look for companies that run PHP 5, MySQL 5 and update all their applications regularly. Even if they sound a little foreign, these are the applications that keep the internet running.

Support

If you really want to start a website, but are slightly frightened at the acronyms and version numbers involved, be sure to investigate a company’s support record. This can only be done properly online, at unaffiliated websites, but it is invaluable to know what you are getting involved with. You’ll always find a mixed bag of reactions, but generally if the dominate response is positive, you’ll be in good hands.

This is by no means the definitive list for choosing a website provider, but everything here you should keep in mind when searching around. The webhosting industry is quite competitive, so be sure to do plenty of reading to find the best deal. I chose Bluehost.com to host wesg.ca because it offers infinite bandwidth and storage, multiple domains and has efficient support, all at an affordable price. Happy surfing!

Disclosure: I am a member of the Bluehost affiliate program.
[tags]websites, blogs, hosting, ISP[/tags]

Tagged with: , ,

Wordpress logoMass Page Maker made it easy to add pages, now Mass Page Remover makes it easy to delete them.

A simple admin panel interface, MPR gives you a starting ID and ending ID as well as a form for specific page IDs. The lower portion of the window displays a browser of pages and posts, making it easy to find the correct page to delete.

It has been tested up to the latest version of WordPress, 3.0. If you have problems with an earlier version, or even if it works properly, please contact me or post a comment.
Read More »

Tagged with: , , , ,

You might notice in the footer of my blog that there is a small item that says My MacBook has been on for 4 days, 20:18 hours. I thought that this might be an interesting thing to share with people.

If this is something you’re interested in putting on your site, here is how I’ve automated the entire process. I’m going to assume that you’re running OS X, and that you have a standard text editor to write basic code.

While originally I made it happen with Automator and an Appescript, helpful commenter phalkunz created an even more efficient method that I will build on.
Read More »

Tagged with: , , , , ,

I’ve been frustrated recently because external hard drives connected to my MacBook have refused to unmount. After resorting to restarting before trying again, I posted my problem to a number of online forums.

Knowledgeable member of the Macworld forums oddlot answered my question with a Unix command called hdiutil that can force eject a drive.

I took this command and wrote a quick Applescript that displays a list of the connected drives and force ejects the one you choose.


tell application "Finder"
  set startupDisk to "Macintosh HD"
  --suppress errors if there are no other drives connected
  try
    set allDrives to the name of every disk whose name does not contain startupDisk
  on error
    display dialog "There are no other drives to unmount"
    return
  end try
  
  set selectedDrive to "Cookie Monster"
  --create the list of drives to unmount
  set selectedDrive to {choose from list allDrives with prompt "Choose the drive to unmount:"} as text
  
  --remove spaces from disk names
  set OldDelims to AppleScript's AppleScript's text item delimiters
  set AppleScript's AppleScript's text item delimiters to " "
  set newText to text items of selectedDrive
  set AppleScript's AppleScript's text item delimiters to "" & space
  set theText to newText as text
  set AppleScript's AppleScript's text item delimiters to OldDelims
  
  try
    --shell script that force ejects the selected hard drive
    do shell script "hdiutil eject -force /Volumes/" & theText
  end try

end tell

I linked this up to a Butler trigger, so now if a drive is uncooperative, I can activate this script with one key combination.

If you wish to use this script as a simple application, copy the code listed into a Script Editor window (found in /Applications/Applescript). You’ll likely not need to change anything, but if your startup disk is anything other than Macintosh HD, you need to change the beginning variable startupDisk. Choose Save As from the File menu and pick Application from the dropdown menu. This will create an application that you can easily double click whenever you need it.

UPDATE: I realized after I posted this that the functionality is broken when the disk contains spaces in the name. The code posted here has been corrected.
[tags]Applescript, Automator, programming[/tags]

Tagged with: , , , , ,