Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2025-08-18 17:36:10



Reply to topic  [ 4 posts ] 
Patch Grabbing Script 
Author Message

Joined: 2009-09-08 01:27:46
Posts: 172
Reply with quote
This is a little script that you can use on Linux to automatically grab the sources for Cool VL Viewer's patches. I had some assistance from falconindy on the #archlinux IRC channel.

You just run this script, and it will auto-download the patch sources into the current working directory:

Code:
#!/bin/bash

rm foo
curl -s 'http://sldev.free.fr/patches/12500/' | xmllint --html --xpath '//a[contains(@href, "patch.bz2")]/@href' - 2>/dev/null | sed 's/ \?href="\([^"]\+\)"/\1\n/g' > foo
wget -B http://sldev.free.fr/patches/12500/ -i - < ./foo



If there is already a script somewhere on the site that does something similar, my head will explode.


2011-02-05 04:33:47
Profile WWW

Joined: 2009-03-17 18:42:51
Posts: 6038
Reply with quote
Your script would fail to grab the *.zip files associated with some of the patches, plus"--xpath" is apparently not recognized in my version of xmllint...

Here is a better script:

Code:
#!/bin/bash

VERSION=12500
BASEURL="http://sldev.free.fr/patches/$VERSION/"
LIST="cvlv_patch_list.txt"

curl -s "$BASEURL" | grep slviewer | cut -d '"' -f 6 >$LIST
wget -B "$BASEURL" -i - <$LIST
rm -f $LIST


2011-02-05 08:38:22
Profile WWW

Joined: 2009-03-18 09:32:02
Posts: 246
Reply with quote
...

wget -m -k --no-parent http://.....

one line.
ok, you'd have a few surplus html files after this, but still. one line, no temp files.


2011-02-05 15:47:11
Profile YIM WWW

Joined: 2009-03-17 18:42:51
Posts: 6038
Reply with quote
Well, if the temp file is what annoys you, here's another script, that will only fetch the relevant files, and will also save you (compared to the first script) the use of curl:

Code:
#!/bin/bash

VERSION=12500
BASEURL="http://sldev.free.fr/patches/$VERSION/"

wget -q -O - "$BASEURL" | grep slviewer | cut -d '"' -f 6 | wget -B "$BASEURL" -i -


2011-02-05 16:58:01
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 237 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.