This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Given a Twitter archive, replace all references to Twitter hosted images with a downloaded local image. | |
# Usage: place in the directory of the Twitter export (at the same level as the index.html file) and run it. | |
# Note: doesn't work for video. Skips images that fail to download. | |
import errno | |
import os | |
import re | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
grep '"tag_name":' | # Get tag line | |
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "mydebian", | |
"name": "My Debian Images", | |
"url": "http://www.debian.org/", | |
"releases": [ | |
{ | |
"version": "6.0.6", | |
"arch": "amd64", | |
"size": 176160768, |