Created
October 2, 2019 22:10
-
-
Save fedarko/4fc177cff9084b9e325dcbe954547edc to your computer and use it in GitHub Desktop.
Convert a github file URL to a raw.githubusercontent.com URL (that can be directly accessed for things like view.qiime2.org or wget)
This file contains hidden or 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
# your link goes here | |
link = "https://github.com/knightlab-analyses/qurro-mackerel-analysis/blob/master/AnalysisOutput/qurro-plot.qzv" | |
# note: this will break if a repo/organization or subfolder is named "blob" -- would be ideal to use a fancy regex | |
# to be more precise here | |
print(link.replace("github.com", "raw.githubusercontent.com").replace("/blob/", "/")) | |
# example output link: | |
# https://raw.githubusercontent.com/knightlab-analyses/qurro-mackerel-analysis/master/AnalysisOutput/qurro-plot.qzv |
Comments are disabled for this gist.