Skip to content

Instantly share code, notes, and snippets.

@g-clef
Created July 17, 2015 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g-clef/60e8ede40977767f34a3 to your computer and use it in GitHub Desktop.
Save g-clef/60e8ede40977767f34a3 to your computer and use it in GitHub Desktop.
lastSeenScripts = set([('http://www.bootstrap.com', 'ab3940bb30dee'), ("/test/boring.js", "ac93027572037cc")])
lastSeenURLs = set([entry[0] for entry in lastSeenScripts])
justFoundScripts = set([("http://www.bootstrap.com", "ab3940bb30dee"), ("/test/boring.js", "ac93027572037cc"), ("/test/malware.js", "d938203cca")])
justFoundURLs = set([entry[0] for entry in justFoundScripts])
newUrls = justFoundURLs - lastSeenURLs
droppedURLs = lastSeenURLs - justFoundURLs
newScripts = justFoundScripts - lastSeenScripts
droppedScripts = lastSeenScripts - justFoundScripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment