diff --git a/README.md b/README.md index 21a5061..3943f2e 100644 --- a/README.md +++ b/README.md @@ -30,35 +30,26 @@ Otherwise, you can use the [pre-built binaries](https://github.com/FooSoft/scraw Executing Scrawl with the `-help` command line argument will trigger online help to be displayed. Below is a more detailed description of what the parameters do. -* **attr**: The attribute containing the desired download path is specified by this argument. -* **dir**: This argument specifies the output directory for downloaded files. -* **vebose**: Scrawl will output more details about what it is currently doing when this flag is set. +* `attr`: The attribute containing the desired download path is specified by this argument. +* `dir`: This argument specifies the output directory for downloaded files. +* `vebose`: Scrawl will output more details about what it is currently doing when this flag is set. ## Example Let's say we want to create a script to download the latest Debian package of [Anki](http://ankisrs.net/): -1. We load up the homepage and are presented with a big download button as shown in the screenshot below: - - [![Anki Homepage](img/anki-thumb.png)](img/anki.png) - -2. Let's copy that link so we can download the latest version with wGet or curl from our script at any time! - - Hmm, it looks like the path `http://ankisrs.net/download/mirror/anki-2.0.33.deb` has the version number embedded in - the filename. This means that even after a new version of Anki is released, our script will keep getting version +1. We load up the homepage and are presented with a big download button as shown in the screenshot below: \ + ![](img/anki.png) +2. Let's copy that link so we can download the latest version with wGet or curl from our script at any time! Hmm, it + looks like the path `http://ankisrs.net/download/mirror/anki-2.0.33.deb` has the version number embedded in the + filename. This means that even after a new version of Anki is released, our script will keep getting version `2.0.33` (unless of course it gets deleted). - -3. Let's inspect the download link in your favorite browser to see what additional information we can get: - - [![Inspector](img/inspect-thumb.png)](img/inspect.png) - -4. It appears that we can easily create a selector for this element: `#linux > a:nth-child(2)`. - - Note that [Chrome](https://www.google.com/chrome/) provides the option to copy the CSS selector for any element, - making knowledge of web technology optional for this step. - +3. Let's inspect the download link in your favorite browser to see what additional information we can get: \ + ![](img/inspect.png) +4. It appears that we can easily create a selector for this element: `#linux > a:nth-child(2)`. Note that + [Chrome](https://www.google.com/chrome/) provides the option to copy the CSS selector for any element, making + knowledge of web technology optional for this step. 5. Now let's create a simple download and install script: - ```bash #!/bin/sh rm -rf /tmp/anki @@ -67,7 +58,6 @@ Let's say we want to create a script to download the latest Debian package of [A sudo dpkg -i /tmp/anki/*.deb sudo apt-get install -y -f ``` - In this script, we prepare an empty download directory and tell Scrawl to scrape `http://ankisrs.net/`, extracting the `href` property of the download link identified by the CSS selector `#linux > a:nth-child(2)`. We then install the package and bring in any unsatisfied dependencies. diff --git a/img/anki-thumb.png b/img/anki-thumb.png deleted file mode 100644 index 0ca660a..0000000 Binary files a/img/anki-thumb.png and /dev/null differ diff --git a/img/inspect-thumb.png b/img/inspect-thumb.png deleted file mode 100644 index 6ea142d..0000000 Binary files a/img/inspect-thumb.png and /dev/null differ