PC Games
• Orb Tutorials
• 2D shoot 'em up Latest Updates
SDL2 Versus game tutorial
Download keys for SDL2 tutorials on itch.io
The Legend of Edgar 1.37
SDL2 Santa game tutorial 🎅
SDL2 Shooter 3 tutorial
Tags • android (3) • battle-for-the-solar-system (10) • blob-wars (10) • brexit (1) • code (6) • edgar (9) • games (43) • lasagne-monsters (1) • making-of (5) • match3 (1) • numberblocksonline (1) • orb (2) • site (1) • tanx (4) • three-guys (3) • three-guys-apocalypse (3) • tutorials (17) • water-closet (4) Books Firmware HF-Tech's chips have changed the world. Embedded into the heads of over 90% of the world's population, they have cured autism, dementia, provided intelligence boosts, and helped to ease some of the more mundane tasks in life. Daniel Blair, hacker and Workshop member, however is not convinced that everything is as rosy as it seems. But is he looking in all the wrong places..? |
A Reddit Wallpaper download script Fri, 27th May 2016I like having new wallpapers, daily. As I most often got them from /r/wallpapers, I decided to write a small script to download them to use on my desktop. The script is rather straight forward. It will download the RSS feed from /r/wallpapers and extract the URLs of the first two jpgs that are listed within, which are then downloaded using wget. It will then resize them to better fit the desktop (some wallpapers are 4K, so I just resize them to my native resolution), and that's that. Okay, there are a few extras: it will first check to see if we're online (by pinging Google), it will then only download new wallpapers if it's been at least 6 hours since the last check. Wallpapers older than two days old will be deleted before the new ones are fetched. Additionally, the user agent is set to be the latest version of Chrome, as Reddit has checks against rogue bots (note: if you run this script too often, your ip address could be banned - best to only run it once every few hours). You can view the code below. Either copy and paste that into a file, or download the wallpaper.sh file at the bottom of this page. Remember to tweak it to suit your own needs (as a minimum, update the paths), and then chmod +x it before running. #!/bin/bash -e TMP="/tmp/wallpapers" DIR="/path/to/wallpapers" LASTDL="$DIR/.lastDownload" UA=`/opt/google/chrome/chrome -version` if ping -q -c 1 www.google.com then if [ ! -f $LASTDL ] || [ `find "$LASTDL" -mmin +360` ] then find "$DIR" -name '*.jpg' -mtime +2 -exec rm {} \; mkdir -p $TMP FILES=$(curl -A "$UA" https://www.reddit.com/r/wallpapers.rss | xmllint --format - | grep -Eo 'http[s]?:[^"]*jpg' | grep -v thumbs | head -2) for FILE in $FILES do wget -c $FILE -P $TMP done touch $LASTDL mogrify -resize 1920x "$TMP/*.jpg" mv $TMP/*.jpg $DIR fi fiDownloads: wallpaper.sh (0Kb) Related News
Orb source code
Lasagne Monsters source code
3 Guys Apocalypse source code
Scraping Amazon's Wishlist
Resizing an array in C
|