summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gpe-misc/gpe-wallpapers/utils/gpe-wallpapers-fetch')
-rwxr-xr-xgpe-misc/gpe-wallpapers/utils/gpe-wallpapers-fetch26
1 files changed, 26 insertions, 0 deletions
diff --git a/gpe-misc/gpe-wallpapers/utils/gpe-wallpapers-fetch b/gpe-misc/gpe-wallpapers/utils/gpe-wallpapers-fetch
new file mode 100755
index 0000000..d42dfbc
--- /dev/null
+++ b/gpe-misc/gpe-wallpapers/utils/gpe-wallpapers-fetch
@@ -0,0 +1,26 @@
+#!/bin/bash
+# Util to help gpe-wallpapers maintainers
+# Angelo Arrifano <miknix@gentoo.org>
+#
+
+GALLERY_URI="http://gpe.linuxtogo.org/gallery/gallery/view_album.php"
+ALBUM="readytousebackgrounds"
+PAGE=1
+PAGES=3
+
+mkdir wallpapers
+cd wallpapers/ || exit 1
+echo "Connecting.."
+while [[ $PAGE -le $PAGES ]]; do
+ wget -q "${GALLERY_URI}?set_albumName=$ALBUM&page=$PAGE" -O /tmp/gpe-wallpapers.html
+ for IMAGE in $(grep -Eo 'src="[^"]+\.thumb\.[^"]+"' /tmp/gpe-wallpapers.html \
+ | sed -e 's;.thumb;;' -e 's;";;g' -e 's;src=;;'); do
+ echo "Fetching $IMAGE .."
+ wget -q "$IMAGE"
+ done
+ let PAGE=$PAGE+1
+done
+
+echo "Creating tarball.."
+cd ..
+tar -cjf gpe-wallpapers-$(date +"%Y%m%d").tar.bz2 *