(As you may have guessed, it only includes betas for Mac OS X, but if there is interest, I could easily make feeds for Windows and Linux too. Let me know if you’d be interested in those.)
“Why?”
Dropbox betas are (usually) very stable and I want to use them as soon as possible, but I don’t want to have to check the forum every day to see if there is a new build.
“Cool idea… where’d you get it?”
I had the idea after reading this post on StackExchange.
I wrote the script myself.
“How does it work?”
A shell script and a dash of magic.
“No, really, give me the nerdy details”
A shell script checks to see where http://forums.dropbox.com/forum-build.php redirects (using the HTTP ‘Location’ header). If the redirect has changed, that means there is a new beta. If there is a new beta, the script generates a new RSS entry.
The script runs via ‘cron’ every few minutes. Since it only checks the HTTP headers, it should cause no noticeable effect on Dropbox’s servers. Certainly less than a bunch of nerds refreshing the forums URL.
“Your RSS sucks and doesn’t work in [Insert RSS Reader Here]”
Sorry.
I have never worked with RSS before. I cobbled together the necessary parts via Google and checked that I was generating valid RSS according to http://validator.w3.org/.
And it works in Google Reader (which is all I really needed).
If there are specific elements that you would like to see added to the RSS feed, I’d be glad to consider adding them, especially if you provide good instructions on how the RSS should be formed.
“I don’t want to use betas I only want official releases”
That’s a reasonable request and I will probably make an RSS feed for that also, because Dropbox does not auto-update very well. But I wanted this first, so I made this first.
The end
I hope you like it.
p.s.
There is an official RSS feed for Dropbox release notes at https://www.dropbox.com/release_notes/rss.xml but the feedburner feed points directly at the DMGs so you can download them.
I use and love Dropbox and almost always run the latest beta version from the forum. The only problem is that I don’t always check the forum every day so I don’t always know when a new version is available.
This script is designed to check the forums for me and see:
what the latest version is
what my installed version is (Mac only)
If the two are not the same, the script will show me the URL to the forum post which announced the new version, and try to show me the download link for the newest Mac beta.
Notes:
requires lynx which is not installed by default on OS X. You can get it at Rudix already compiled and in a nice OS X installer package.
this script relies heavily on web scraping which means that it is extremely likely to break in the future if/when Dropbox changes things
Feel free to improve upon it. If you do, please let me know. Any questions, please feel free to ask me.
#!/bin/sh
#
# Author: Timothy J. Luoma
# Email: luomat at gmail dot com
# Date: 2010-05-28
#
# Purpose: find the latest Dropbox beta, compare to installed version (Mac only)
# Requires lynx. Download for OS X here:
# http://rudix.org/packages-jkl.html#lynx
# customize if needed
PATH=$HOME/bin:/usr/gnu/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/X11R6/bin:/root/bin:/usr/local/git/bin
# Temp file
TMP=/tmp/latestdropbox.txt
# Dump the source of the page, looking for 'Experimental Forum Build'
# first two lines should produce something like this :
#
# $ lynx -source http://forums.dropbox.com/|fgrep -i 'Experimental Forum Build'
# <td>Sticky: <big><a href="http://forums.dropbox.com/topic.php?id=20472">(5/27) - Experimental Forum Build - 0.8.64</a></big></td>
#
# From there we just want the URL and the build number, so we throw it back into lynx
# which is happy to parse the HTML for us, changing it to something like this:
#
# Sticky: [1](5/27) - Experimental Forum Build - 0.8.64
#
#
# References
#
# 1. http://forums.dropbox.com/topic.php?id=20472
#
# We really only want the 'experimental' line and the URL, so we egrep those
# and 'sed' out the bits we don't want
#
# Then we dump the output to a temp file, which should look something like this:
#
# 0.8.64
# http://forums.dropbox.com/topic.php?id=20472
#
# Latest version number on top, URL to download it on the bottom
#
lynx -source http://forums.dropbox.com/ |\
fgrep -i 'Experimental Forum Build' |\
head -1 |\
lynx -dump -stdin |\
egrep 'Experimental|http://forums.dropbox.com' |\
sed 's#.*Experimental Forum Build - ##g; s#.*http#http#g' > $TMP
if [ ! -s "$TMP" ]
then
# if the temp file is 0 bytes we know something went wrong, exit
echo "ERROR: Empty output file ($TMP) which probably means http://forums.dropbox.com/ is not available
or they changed the format of the post about the latest beta"
exit 1
fi
# So far everything we've done should work on any "Unix-like" system.
# And will continue to work as long as Dropbox keeps the same format for their posts on the forum
# which seems fairly likely at least in the short term
# We could end here. (remove the '> $TMP' above and it will go to 'stdout' and voilà
# But if we're on a Mac that has the Dropbox.app already installed,
# We can compare the currently installed version to the latest version
# Change this if you don't have Dropbox installed in /Applications/
DROPBOX=/Applications/Dropbox.app
# This is where Dropbox keeps version information
PLIST=$DROPBOX/Contents/Info.plist
if [ ! -f "$PLIST" ]
then
# IF we didn't find the plist file, Dropbox is probably not installed
# or this isn't a Mac system, so let's just say what we know
# by 'cat' ing the tmp file to stdout and exiting
cat "$TMP"
exit 0
fi
# Get the version number of the currently installed version of Dropbox
CURRENT=`fgrep -A1 'CFBundleVersion' "$PLIST" |\
fgrep '<string>' |\
sed 's#.*<string>##g ; s#</string>##g'`
# This will equal the latest beta version
LATEST=`head -1 $TMP`
# Now show installed vs latest
echo "$LATEST (latest)
$CURRENT (installed)"
if [ "$CURRENT" != "$LATEST" ]
then
# if the current is not the latest,
# show the URL to get the latest beta
URL=`tail -1 "$TMP"`
# Dump the URL looking for a specific link that ends with "dmg"
DMG=`lynx -dump "$URL" |\
egrep "http://dl-web.dropbox.com.*dmg" |\
tail -1 |\
awk '{print $NF}'`
echo "
$URL
$DMG"
fi
exit 0
# EOF
The folks at TUAW are big Dropbox fans but I thought I’d point out 5 articles that I’ve written about using Dropbox with various Mac apps to show what it can do.
(make sure that the folder ~/Dropbox/Public/Screenshots/ exists :-)
which not only makes them all available on any computer that I use, but it also makes it easy to share a screenshot with someone: instead of sending them the picture, I just copy the public URL.
Sign up through this link and we’ll both get some extra space for free. I stand behind my tips even if you don’t want to use my referral link.
I like putting my screenshots in one central location so I can later access them from any computer. For this I use Dropbox which already has a ~/Photos folder. I make a sub-folder in it and then do