Skip to content

Instantly share code, notes, and snippets.

@atomotic
Last active February 21, 2018 10:45
Show Gist options
  • Save atomotic/c271159eabc7ec4516c23cbde9b37f48 to your computer and use it in GitHub Desktop.
Save atomotic/c271159eabc7ec4516c23cbde9b37f48 to your computer and use it in GitHub Desktop.
check if Software Heritage archive contains your code
function swh-check() { curl -s --data "q=$(sha1sum $* | cut -d " " -f 1)" https://archive.softwareheritage.org/api/1/content/known/search/ | jq . }
@atomotic
Copy link
Author

$ swh-check /etc/Muttrc
{
  "search_stats": {
    "pct": 100,
    "nbfiles": 1
  },
  "search_res": [
    {
      "filename": null,
      "found": true,
      "sha1": "d6736c5864bfd5a61af1217206c0375558ed233c"
    }
  ]
}

@ardumont
Copy link

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

Cheers,

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