01-24-2014, 10:04 PM
I want a macro that get's the URL of latest installer (highest version) from this page:
http://sourceforge.net/projects/portabl ... 20Versions
It must be done without using the browser:
Each .exe link contains the version number like this:
I created this and seems to work
Macro get_chrome
My question:
I wanted to know if there might be a more robust way to do this through QM?
The method I used, "freezes/hangs" macro for about 20 seconds, the macro doesn't really freeze because it is processing in the background.
But I wanted to create an .exe from this so I can deploy this on more pc's, that's why the "freezing" might become confusing for other users.
(it's not a big problem, but if there is a more robust way to handle this than that would be very welcome).
http://sourceforge.net/projects/portabl ... 20Versions
It must be done without using the browser:
Each .exe link contains the version number like this:
...s/GoogleChromePortable_32.0.1700.76_online.paf.exe/download...
...s/GoogleChromePortable_31.0.1650.63_online.paf.exe/download...
...s/GoogleChromePortable_31.0.1650.48_online.paf.exe/download...
...s/GoogleChromePortable_30.0.1599.69_online.paf.exe/download...
...s/GoogleChromePortable_29.0.1547.76_online.paf.exe/download...
I created this and seems to work
Macro get_chrome
str s
IntGetFile "http://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/Additional%20Versions" s
out
HtmlDoc d.InitFromText(s)
ARRAY(MSHTML.IHTMLElement) aLinks aImages
d.GetHtmlElements(aLinks "a")
ARRAY(str) all_paf_links
int i x
str tmp0 tmp1 tmp2 tmp3
str latest_chrome_url
for i 0 aLinks.len
,tmp0=aLinks[i].getAttribute("href" 2)
,tmp1="http://sourceforge.net/projects/portableapps/files/Google%20Chrome%20Portable/Additional%20Versions/GoogleChromePortable_"
,x=find(tmp0 tmp1)
,if(x>=0)
,,all_paf_links[]=tmp0
all_paf_links.sort(9)
latest_chrome_url=all_paf_links[0]
out latest_chrome_url
My question:
I wanted to know if there might be a more robust way to do this through QM?
The method I used, "freezes/hangs" macro for about 20 seconds, the macro doesn't really freeze because it is processing in the background.
But I wanted to create an .exe from this so I can deploy this on more pc's, that's why the "freezing" might become confusing for other users.
(it's not a big problem, but if there is a more robust way to handle this than that would be very welcome).