A Challenge

This is primarily intended to be a bit of fun but it does have a purpose.

The Challenge.
Find a way using a simple command line command to fin the latest version number of the Adoble flashplayer.
The command must be suitable for incorporation into a bash script and ideally should be a single line.

The Prize: Nothing big I’m afraid. You get your name included in the spec file for the non-free rpm of flashplayer
but as a bonus your flashplayer will always be up to date.

The challenge will run for one week with the best solution selected at the end of the week.
In the event of identical solutions the first one receive will be the winner.
Have fun

2 Likes

First try (I’m not trying to compete) :

wget -q -O - https://get.adobe.com/flashplayer/about/ | grep -A 3 "Linux" | grep -e "<td>[[:digit:]]." | awk -F '</*td>' '{ print $2 }'

or

wget -q -O - https://get.adobe.com/flashplayer/about/ | grep -m 1 -e "<td>[[:digit:]]." | awk -F '</*td>' '{ print $2 }'

EDIT : the field separator of awk disappeared (because of < and >)

$ wget -q -O - https://get.adobe.com/flashplayer/about/ | grep -A 3 "Linux"| tail -n 1|sed -e "s/<\/td>//"|sed -e "s/<td>//"|cut -f2
27.0.0.187

I hope they will not change the about page :wink:

I was wondering the same thing …
I just see that the field separator of awk disappeared. I should have chosen another style of emphasis.

@luca: one way to simplify your command

wget -q -O - https://get.adobe.com/flashplayer/about/ | grep -A 3 "Linux"| tail -n 1|sed -e "s/[[:space:]]*<[\/]*td>//g"

EDIT: not really simplified, shorter but less readable …

1 Like

mine is readable only because with regexp I’m very unskilled :wink:

and this?

$ curl -s http://get.adobe.com/flashplayer/about/| sed -n ‘/Linux/,/</tr/s/[^>]*>\([0-9].*\)<.*/\1/p’

not entirely mine

:clap:
Clever. I never used sed this way before.
This line should work also:

curl -s http://get.adobe.com/flashplayer/about/ | \ sed -n '/Linux/,/<\/tr/s/.*>\([0-9].*\)<.*/\1/p'

(I suppressed “[^>]” after the command “s”)

The only place to guarantee to get it is here Adobe Flash Player Download

$ curl -s https://fpdownload.macromedia.com/pub/flashplayer/masterversion/masterversion.xml| grep -m 1 “linux”|cut -d ‘"’ -f 2|sed -e “s/,/./g”

Smart ass :slight_smile:
The fascinating thing about https://get.adobe.com/flashplayer/ is that it does return the version number but trying to grep for it doesn’t seem to work.

I think the reason is that the number is displayed by a javascript which, of course, cannot be executed by curl or wget.

Yes, and probably it reads from masterversion.xml :wink:

@luca: you win :wink:

1 Like

no challange, but a very constructive cooperation :wink:

As an exercise, the last command you gave using only sed as filter:

curl -s https://fpdownload.macromedia.com/pub/flashplayer/masterversion/masterversion.xml  | \ 
sed -nr  '/linux/{s/.*"([0-9].*)".*/\1/p;q}'

EDIT: sorry I forgot to substitute the commas …

curl -s https://fpdownload.macromedia.com/pub/flashplayer/masterversion/masterversion.xml  | \ 
sed -nE  '/linux/{s/.*"([0-9].*)".*/\1/;s/,/./gp;q}'
1 Like

I was saving the second part for later :slight_smile:

I think I have to declare Luca the winner here though credit to jcl for the use of sed alone…
Luca I will patch wpa-supplicant for 2014 now we are less pressured by the release process.

Here’s the second part.
Go to GitHub - OpenMandrivaAssociation/flash-player-plugin at automate
and clone this branch of flash-player-plugin.
In the normal scheme of things this rpm only gets updated when someone notifies a developer that the rpm doesn’t work any more this is not ideal to say the least. The reason for rpm failing is is that adobe only ever have one version at their download page so when the version is updated the old one disappears and the rpm fails.
Currently what happens the user has to get cross becasue he can’t install flash-player into their browser if they know where to post they will then have a moan that is doesn’t work if things go well a developer gets to hear about it and it gets fixed. What the developer has to do to update the version is to first find the new version number and enter it into the specfile under the Version tag then run the script “update.sh” and then rebuild the rpm.

This really needs to be automated

To be able to do this a cron is needed to check the version periodically and if changed update the package specfile and run update.sh and then rebuild the package so that it is current. It’s possible to test this on a local machine. Investigate the build tool abb if you are not already familiar with it. Whether the automation process is installed on the users machine when the initial install take place is debatable but certainly cron service on abf should be utilised to provide the facility to update.

Prize. Well lots of kudo in the forums; Your copyright in the work and a Lexar High-Speed USB3 jump drive.

1 Like

Thanks. :smile:

Thanks too …