Static "latest" headless download link

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

quyxkh
Smart Inserter
Smart Inserter
Posts: 1029
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Static "latest" headless download link

Post by quyxkh »

dgw wrote:From what I can tell,

Code: Select all

https://www.factorio.com/get-download/latest/headless/linux64
downloads the experimental release if available. I haven't been able to find a way to download the latest stable release. Does one exist?
A little light scraping seems to work pretty well:

Code: Select all

#!/bin/sh
mylatest=
check=https://www.factorio.com/download-headless/stable
latest=$(curl -sL $check | awk '/get-download/{print get""$2;exit}'  FS=\" get=${check%/down*})
[[ $latest != $mylatest ]] && {
  curl -sL "$latest" > newrelease.tar.xz
  sed -i '0,/mylatest/s|mylatest=.*|mylatest='$latest'|' "$0"
  haveyourwaywith newrelease.tar.xz
}

dgw
Fast Inserter
Fast Inserter
Posts: 197
Joined: Tue Apr 12, 2016 7:06 pm
Contact:

Re: Static "latest" headless download link

Post by dgw »

Jap2.0 wrote:Why would you wait for the stable :)?
It's not for me, it's for a potential Hacktoberfest contribution to resolve a feature request in Bisa's init script I'm toying with.

Edit (didn't see the second page on mobile): Thanks for the Bash snippet, I might end up using that. :)

Post Reply

Return to “Ideas and Suggestions”