Skip to content

Instantly share code, notes, and snippets.

@atomotic
Created July 1, 2016 12:33
Show Gist options
  • Save atomotic/87bb08209cbeea3778063118aa945a26 to your computer and use it in GitHub Desktop.
Save atomotic/87bb08209cbeea3778063118aa945a26 to your computer and use it in GitHub Desktop.
~ mediawiki=$(curl -s https://raw.githubusercontent.com/wikimedia/mediawiki/master/index.php | gsha1sum | cut -d " " -f 1)

~ curl -s --data "q=$mediawiki" https://archive.softwareheritage.org/api/1/search/ | jq .
{
  "search_stats": {
    "nbfiles": 1,
    "pct": 100
  },
  "search_res": [
    {
      "sha1": "0b67c222d48ff7d8ac00570007f16d60bdbcc6a2",
      "found": true,
      "filename": null
    }
  ]
}
@ardumont
Copy link

Hello, jsyk, that api endpoint has migrated to /api/1/content/known/

Also, you might have a typo in your git around | gsha1sum | , I'd use sha1sum (your other gist confirms it).

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment