иконописПодарък иконаI have a hard drive full of which spends most of it's time connected to the PS3 in the living room. When trying to find something to watch, a list of just filenames isn't always very useful. Sometimes I might not remember what the film is about or remember if I've already seen it. It's also a pain to have to fire up the PS3 and the hard drive just to see the list of movies.
To get around this I wrote an applescript that gets the list of files on the hard drive and attempts to get the movie names from them, ie. strip the extension and anything in brackets. The script then generates a simple HTML file which is uploaded to an FTP server.
HTML5 Local Storage is used to store the data so it doesn't have to query the api with every page load (a modern browser is required for this). Movies can be flagged as something you want to watch or as 'already seen'.
Instructions: - Upload the css, images, inc and js folders to a folder on your server - Edit the absolute URLs in the scripts.js to match the location of your inc folder - Edit the FTP settings and paths in createHTML.scpt - Run the applescript on your computer and check to make sure the index.php file has uploaded to the correct location - Open the index.php folder in your browser (if you don't get any info the first time just reload the page
This setup is certainly not perfect - it will not index files in subfolders and will not get every movie name right. You might want to amend the applescript if your naming convention is different.
Here's an example
And the download link
Its a turn based strategy game, so games can go on for weeks but you can spend five minutes making your moves and then get back to work while others take their turn.
In my first attempt at writing facebook applications, I've melded together the facebook and weewar APIs to create a widget which displays your weewar stats and current games on your profile. Links to weewar.com on the widget are also accredited to you as the referrer, which means you gain the points needed to become a Weewar Pro!
Weewar is currently invite only. If anyone wants an invite, leave a comment.
This script checks a feed of the UK National Lottery results and checks it against your numbers. It then saves a text file informing you how many numbers you have matched and I use GeekTool to display that information on my desktop.
I also use a program called Cronnix to run this script at various intervals the day after the draw (osascript "/Library/Scripts/lotto.scpt").
This little app that I wrote might prove handy to someone - especially those who are trying out Friday's Poker post.
You may know that when using iChat over the local network with Bonjour there is no facility for a group chat so I wrote iGroupChat. You type the message and then hit return and the message is sent to everyone in the iChat Bonjour buddy list who's status is Available. ">>" preceeds the message so people can tell that it is a group message.
We have noticed recently that it is not 100% reliable, some people get missed out - quitting and restart that persons iChat seems to work but I'm not sure why its not working every time.
I set this up because I was becoming increasingly mythed about the lack of small and simple network games that can be played in an office environment without the risk of being sacked.
The idea is quite simple, though I will probably complicate things more than necessary, but here goes . . .
The idea is that all the players connect to a hard drive (or maybe a network server), on this drive is a folder called Poker that contains a number of subfolders. One subfolder is called Deck, this folder contains 52 images of each card in a standard deck. Each player has their own folder in the Players folder, and each players folder contains a Hand folder and a Chips folder. There is also a Community Cards folder which everyone can see.
At the start of a game, chips (image files again) are shared out into everyone's Chips folder. Then the Deal applescript is run by the dealer, this script first deals two player's cards to their Hand folder. A round of betting is made by dragging chips into the Pot folder and iChat Bonjour is used to announce what you are betting.
When everyone has bet, the Deal script is run again, this time dealing the first three cards to the Community Cards folder - this is followed by another round of betting.
After all the community cards are dealt and all the bets are made, there is the showdown via iChat, the winner drags the chips from the Pot to their own Chips folder and everyone drags their cards (not forgetting the community cards) back to the Deck ready for another game.
There is a little bit of set up involved. The Deal script needs to be opened in Script Editor and the possiblePlayers property set up with each players name. A folder for each player needs to be set up in Players (the name must match the name in the Deal script), each players folder needs to contain a folder called Hand and a folder called Chips (there is also a script in the Chips folder that can be double clicked and will add up the value of the chips in this folder).
The property theGame needs to be edited to provide the path to the Poker folder (this is an applescript path - /Volumes/ not required). There is another script which updates the name of a file called TOTAL - $0 in the Pot folder with the value of the chips in the pot. This script needs to be moved to /Library/Scripts/Folder Action Scripts/ and you will need to attach this as a folder action to the Pot folder.
I think that's about it. Leave a comment if it doesn't work or if I've missed anything and I will try and sort it out. Here's the download. Enjoy!
This is going to brief as its my second attempt to write this post - the first was interrupted by a system wide crash. (Mac's don't crash my arse!)
I've been trying to learn cocoa and have found developers blogs and especially their sample code to be very helpful, so I've decided to post my collection of (probably useless to most) scripts and source code.
So you can expect to see a few test projects and scripts posted as soon as I sort through all the crap.
Does anyone have a list of spam keywords I can add to the Wordpress blacklist of words it will not allow in posts?
This is getting ridiculous. The more I add to the blacklist, the more seem to get through.
I had been working on a similar project for fun and for my own use, however, iAlertU doesn't currently work with iBooks or PowerBooks, so I thought people might be interested in this.
In the stuffit file is a version for the iBook, a version for the Powerbook and also it's source (an Xcode project). It may also work on the MacBook Pro, but I am not able to test that.
It differs from iAlertU in that there is obviously no remote activation, though this could be set up to work from a bluetooth phone using an app like the excellent Romeo. To activate the alarm simply double click the icon, to deactivate, quit the app.
Uses motion.c. Copyright Christian Klein.
While checking out my site stats to see how many people have visited, downloaded iQuotes, and how many people have accessed the RSS feed of quotes, I noticed that I had over 20,000 hits from one IP address. The next highest number of hits for one IP address is only 2,500, and the next 263.
Obviously, I felt compelled to find out who it was so I googled for IP address Trace and entered the address. The name came back as 17-202-13-240.apple.com. A traceroute tells me that it passes through San Jose at some point.
Now I don't fully understand the IP address so I wondered if anyone could enlighten me on the significance of this.
Is it really Steve Jobs, sitting at his desk at 1 Infinite Loop reminiscing about the old times while watching my screensaver on his Intel Powerbook, or is there another explanation for this?
While researching Quartz Composer I came across very cool application called Quartz Desktop.
It enables you to play Quartz Compositions, such as iQuotes and Apple's RSS screensaver.