#!/bin/bash
# Usage: $basename snap_packagename
PACKAGE=$1; curl -s -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/$PACKAGE | jq '."channel-map" | map(select(.channel.architecture == "amd64" and .channel.name == "stable")) | .[0].download.url'