Copy-Paste to XML file fails

For some reason, copying the data for the description of a Podcast and then pasting this into the XML file I’m creating doesn’t work. In one instance, it just left the field blank when adding this Subscription to iTunes, yet typing this very same information in worked perfectly. Apparently, however, using é, and I assume other extended characters, doesn’t work - you need to encode characters. Otherwise, iTunes decides the XML file is invalid - which it may well be…

Update: the XML file is indeed invalid, unless you have defined an encoding that allows this type of character, such as, at the start:

    <?xml version="1.0" encoding="UTF-16"?>

Importing Older Podcast Episodes

I’ve found that some of the older ABC podcast episodes are still on the server, but don’t appear in the XML file. How then do you get them into iTunes? If you download the file, using for example wget, the file is a regular MP3 file. You can import this into iTunes, and it will play, and get most of the info about the Podcast from the ID3 tags. However, it will not be a Podcast. It will be a normal audio file, or what iTunes calls Music. Basically, iTunes will only flag a file as a Podcast if it is downloaded through iTunes. This is crappy for a couple of reasons, the first is that iTunes tries to download 3 files at a time, and this chokes my connection, causing all of them to drop out. It then tries the next file as each one fails, resulting in only the last one in the download queue to actually finish. The second is the example above: that I have some older episodes I want to import. Red Sweater Blog to the rescue. Daniel has written a program called TypeCast, downloadable from the page A Home For Wayward Podcasts, which can sort-of solve the problem. You can set the relevant data in the Podcast, such as name, and description, but not the release date. Nor will it add the file into the previously listed subscription, instead creating a new subscription each time you import it. Apparently these multiple subscriptions, if the have the same name, will only appear once on the iPod, but surely there’s a better way. My plan is as follows:

  1. Change the URL of the Podcast Subscription you want to insert a file into. Point it toward a server you have access to, like Personal Web Sharing on your machine (recommended).
  2. Move the relevant files to the right location on your computer, so they are available via the web server.
  3. Generate the required XML file, including grabbing data from the MP3 and iTunes, and allowing the user to add other info, such as the Release Date.
  4. Update the desired Podcast Subscription.
  5. Return the URL of the Subscription to it’s normal value.
  6. Clean up any extra files.

Now, I’m unfortunately stuck at the first item. There doesn’t seem to be an AppleScript method for getting the URL of a Subscription, let alone the ability to set it. You can change the URL of a Podcast Feed if you own the feed, using a special iTunes XML tag. However, as far as I can see, the only way is to edit my /etc/hosts file (and/or the OS X equivalent) and put in an entry that will override the value. Not really something I want to have to do. And I’m not sure if I can map just one directory to a location, or if I’ll need to create the whole tree under my server’s root directory: http://www.abc.net.au/rn/feeds/mind.xml At least I’ll only need to do that once: all of the Radio National feeds appear to be in the same place, just different XML files.

Note: there is an alternative method of achieving the first item. Rather than change the feed, you can change the setup of your computer, so that the server name referenced in the feed points to your computer’s web server instead. Doing this temporarily is easy if you have a batch of files that need to be imported once only, like an archive from before iTunes was your Podcatcher.

SAO Aussie Quiz

SAO Aussie Quiz Yay! I’m truly an Aussie, as I got 20/20. I reckon’ that most city slickers won’t have heard #10. Of course, the real phrase is “Come behind!”, and the alternate is “Get away back!” My only hassle is that it should be smart_arses_.com (For all of my overseas readers, that’s how we pronounce the word. Arrrrse. Long R.).

ABC Podcast Feeds vs. Files

As a latecomer to Podcasting, I’ve missed a whole lot of stuff from the ABC’s excellent range of Radio National podcasts. And I’ve managed to download most of the ‘casts from the feeds that I have subscribed to, but I thought I might see what other stuff is still on the server. Luckily, the ABC use an easy to decode system for naming most of their podcasts. For instance, “All in the Mind”, a show about Psychology and the Mind, is stored in files like: http://www.abc.net.au/rn/podcast/feeds/mind_20051231.mp3 The first bit stays the same, and the number is just yyyymmdd. Thus, even though the feed only lists the last 4 programs, the server seems to have the last 9. Beyond that, I just get file not found errors. Now the only trick is to see if using wget will mean that I can import them into iTunes, and have them show up as Podcasts, including all of the data. Hopefully that is all coded into the ID3 tags, but I’ll post the results.

Dear MyDomain.com

(This is a copy of the support request I sent through to MyDomain.com minutes ago) Dear MyDomain.com, I have noticed that emails sent through the email forwarding system do not always arrive, and often do not arrive promptly. Whilst the problem doesn’t seem to be occuring right now, earlier today I sent a test email, and it still has not arrived. I sent it at 2:14 pm (+1030 6 Feb 2006). It is now 6:18pm. My partner also has a different domain registered with you, and has noticed that a large amount of email is not delivered, or is delivered late. In some cases, up to a week late. The error in question for one particular email was:

After 3 days the following message could not be delivered to user@domain.com at host domain.com. The last attempt to send this message failed because no answer was returned by a DNS.

(Obviously, user@domain.com is replaced by a valid username and domain). This has occurred from mutliple senders, and is unnacceptable. The domains registered are used for business purposes, and not being able to have prompt delivery causes lost business. I moved my domain registration to mydomain.com because I thought they were a reliable service; I may reconsider renewing my domain (and other domains I am involved with) unless service provision improves. You FAQ page 873 is clearly out of date - there are problems with your servers at some point. Whether it is a DNS issue, or a mail forwarding issue, it is impacting on your providing of a service. This email requires a reply. Regards, Matthew Schinckel matt@schinckel.net (or matt.schinckel@gmail.com if the forwarding service is down again).

What a Weekend!

It started on Friday night with Touch training. I coached rather than training, as I was carrying a bit of a hamstring injury, and I wanted to give it a bit more rest. Still, it meant I didn’t get home until around 8. I’m just glad I chose not to ride my bike! Saturday was the annual Colley Reserve 5-a-side Touch Carnival. Normally Touch is played with 6 on the field, but for a more exciting game, and because the fields are a bit smaller, this carnival plays with 5. It’s mixed, so 3 boys and 2 girls are the order of the day. I played in the UniSA team, knowing only two of the players beforehand. The guys, and most of the girls were pretty nice people, and we wound up making the final in the Pool B division. Which we lost, to a team that pretty much plays together all of the time. When I got home, at around 6pm or so, I started doing some editing on my post I’m writing over on OmniNerd. I actually spent a fair bit of time on this, and although I disagreed with the editor’s comments on a couple of things (like placing an embedded clause in commas, something I do) I feel that the feedback made my article better. It’s still not ready to publish, but it’s probably 75% of the way there. The most interesting thing for me is that it’s a different style of writing than a blog post. A blog post, by it’s nature, is very free-flowing, and can at times lack structure. I very rarely edit my posts on this blog, although I sometimes correct errors. If I make them. (Reminds me of the joke: I was wrong once. I thought I was wrong, but I was actually right.) By the time Jaq got home from little Shae’s birthday party (9:30pm), freaking out because there was a big spider on the car, which I had to squish for her, I was about ready for bed, so I dozed almost right off. Jaq had to head into Uni this morning at 11, so I got up just as she left, and started finalizing my Tax documents. I put all of my stuff into a spreadsheet, and it didn’t really take as long as I thought it might. Then, I caught up on all of my RSS feeds, and by the time Jaq got home this time, I had to head off to State League. I played in the Mixed, where we won 8-2 (I only scored one of these, but set up a couple of others, including a great boomer with Karina McL), and then coached the Mens from the box (there is another playing coach, but sometimes it’s handy to have extra eyes off the field).

Anti-CD/DRM Pledge

‘I will pledge to never purchase a CD contaning any form of Digital Rights Management (DRM),’ - PledgeBank

Deadline to sign up by: 6th February 2006 3,745 people have signed up (3245 over target)

This Week in PostSecret

I’m continuing to archive and present the pick (IMHO) of the week’s PostSecret entries. Actually, a very similar thing happened in my family. Apparently my Dad kicked a cat, and my sister and I didn’t find out until her 21st birthday that it hadn’t been bitten by a snake. This last one is only in here for the Speeling Poleese. That’s a horde of barbarians, but people hoard things. From Apple’s Dictionary.app:

USAGE Take care not to confuse the same-sounding words hoard and horde. A hoard is ‘a secret stock or store of something’ (a hoard of treasure), while a horde is a disparaging word for ‘a large group of people’ (hordes of fans descended on the stage). One way to remember the difference is to think of ‘stashing your hoard behind the loose board’ (note the spelling likeness of hoard and board).

iTunes Rating Distribution

As an adjunct to another project I am working on (basically an extended version of the experimental writeup I did about iTunes Ratings), I had cause to wonder as to the distribution of ratings in my iTunes library, and in other peoples. I may be unusual in that when I import an album, I grab the whole lot. Even if I really only like one track. I just feel some day I may want to listen to the whole lot! Anyway, I came up with the following script to get the data. Mac only, I’m afraid. Possible to write a much slower version that scans the XML file manually, but I’ll leave that as an extension to the avid reader.

    #! /usr/bin/env python
    
    import Foundation # Required PyObjC installation.
    import os
    
    library =  os.path.expanduser('~/Music/iTunes/iTunes Music Library.xml')
    
    db = Foundation.NSDictionary.dictionaryWithContentsOfFile_(library)
    tracks = db[u'Tracks'].itervalues()
    
    ratingcount = {}
    for i in range(101):
        ratingcount[i]=0
    
    for track in tracks:
        try:
            ratingcount[int(track[u'Rating'])] += 1
        except KeyError:
            ratingcount[0] += 1
    
    fp = open('RatingData.csv','w')
    for i in range(101):
        fp.write(str(i)+","+str(ratingcount[i])+'\n')
    fp.close()

Plotting this data gives the following graph: Clearly, there are a couple of spikes, most likely from having rated tracks initially on a normal iTunes scale (0-5 stars). I’ve changed the plot scale so you don’t see the zero-rated tracks, as they skew the data totally, and most of them are in fact unrated, rather than zero rated. If I scale my ratings down to full stars (and discard all of the unrated tracks), then my data looks more like: Which is what I expected. And shows that I am probably pretty harsh on my music library - or I dislike most music a bit. • The final plot shows when rating as half-stars, that is, rounding down to the nearest 10, and discarding unrated tracks.

Religion as Delusion?

I’m partway through the 24/9/2005 edition of ABC Radio National’s Podcast of their program All In The Mind. The program description is:

SUMMARY: Cotard’s syndrome is the belief that you have died, and for sufferers it is a terrifying state. Delusions can take many forms, from widespread paranoia to a specific and singular delusion - you might think an impostor has replaced your spouse. These misbeliefs are commonly associated with schizophrenia, but they can also occur in people with brain injuries, Huntington’s and Parkinson’s disease and dementia. The Macquarie Centre for Cognitive Science is seeking to explain delusions by developing a model of how we all come to accept or reject beliefs. We see how this research is progressing.

I don’t know that much about Schizophrenia, but early in the program they are talking about how people with this condition cannot (bear to?) look at faces of people who are angry or fearful. A little later on, the following phrase is used:

[Delusion is] a strongly held belief for which there isn’t any evidence.

I’m not going to make a further statement as to the similarity between this and religion. I’ll let you decide. Flames cheerfully accepted.