In a terminal start a server.
$ python -m SimpleHTTPServer 8000In another terminal set up the cgroups freezer.
| // init | |
| let xhr = new XMLHttpRequest() | |
| let domain = 'https://read.amazon.com/' | |
| let items = [] | |
| let csvData = "" | |
| // function | |
| function getItemsList(paginationToken = null) { | |
| let url = domain + 'kindle-library/search?query=&libraryType=BOOKS' + ( paginationToken ? '&paginationToken=' + paginationToken : '' ) + '&sortType=recency&querySize=50' | |
| xhr.open('GET', url, false) |
In a terminal start a server.
$ python -m SimpleHTTPServer 8000In another terminal set up the cgroups freezer.
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |
#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.
Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.
| (function (window, document, $, undefined) { | |
| if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!'; | |
| function require(name, url) { | |
| if (window[name] === undefined) | |
| return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url }); | |
| } | |
| $.oauth = function (options) { | |
| var d = $.Deferred(); |