Skip to main content
Solved

Grab version number from website

  • September 14, 2015
  • 4 replies
  • 8 views

anverhousseini
Forum|alt.badge.img+11

Hi

I'm creating an update script for the application Dropbox.app. Now I would like to grab the version number from https://www.dropbox.com/install. I tried with following shell command:.

#!/bin/sh
latestver=`/usr/bin/curl -s -A https://www.dropbox.com/install | egrep -o '<span id="version_str">* for Mac</span>'`

But it doesn't work. Any hint? Thanks!

Best answer by mm2270

This may help.
A code snippet from a script I have that gets the latest version info (and the full download location also, but on a separate line)

curl --connect-timeout 4 --max-time 4 -sf "https://www.dropbox.com/download?plat=mac&amp;full=1" 2>&1 | awk -F'"' '/<a href=/{print $2}' | awk -F"/" '{print $NF}' | sed -e 's/^Dropbox%20//;s/.dmg$//'

4 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7886 replies
  • Answer
  • September 14, 2015

This may help.
A code snippet from a script I have that gets the latest version info (and the full download location also, but on a separate line)

curl --connect-timeout 4 --max-time 4 -sf "https://www.dropbox.com/download?plat=mac&amp;full=1" 2>&1 | awk -F'"' '/<a href=/{print $2}' | awk -F"/" '{print $NF}' | sed -e 's/^Dropbox%20//;s/.dmg$//'

anverhousseini
Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • 98 replies
  • September 14, 2015

Thanks! Now it works.


anverhousseini
Forum|alt.badge.img+11
  • Author
  • Valued Contributor
  • 98 replies
  • September 16, 2015

I saw that you created a UpdateCoreApps Script which contains an update script for Office 2011. Would it be possible to separate this part from the rest? So that I can use just the Office 2011 part?


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7886 replies
  • September 16, 2015

@anverhousseini I suppose it could, though its not necessary to do that. That script was designed so you can pass a string of whatever application you want it to check on and update (if needed) when the script is run. So you can just send "Office" to the parameter and it will only check on that application and skip everything else.

But, that script has basically been replaced by a more advanced version that I haven't published yet, so I can't guarantee that one will continue to work. I'm not updating that older script anymore. I also plan on incorporating Office 2016 into the new one at some point, but I haven't worked on that yet.