The folder examples holds a few examples that show you how to use dyer integrated with dyer-cli, and of course there are many explanations inside each example.
They are three examples given in the directory, and some description are provided respectively.
dyer-dieselshows how Database integrates with dyer usingdieselsimple-demoshows how to normally build a apptemplateshows a template generated bydyer-cli
Make sure that rust (latest version recommended) and cargo are installed in your OS, then clone this repository with:
git clone --depth=1 https://github.com/HomelyGuy/dyer.gitthe xpath-stable feature requires C library libxml2 installed, you can refer to rust-libxml for more details.
thexpath-alpha feature is rust-native, don't require any external library, but currently is not stable and remains to be stabilized in the future.
One more thing that this crate requires a safe popular cryptography library OpenSSL, some additional stuff is needed to compile. in general,
# for debian-base OS
sudo apt install pkg-config libssl-dev
# for Arch
sudo pacman -S pkg-config openssl
# for MacOS
brew install opensslThings is a little complicated for Windows users, but it's okay if you follow the steps:
-
OpenSSL installation: you can install 3rd-party binary OpenSSL (recommended) or compile it from source. If you install
git-bash, then OpenSSL is already installed, anyway, open your prompt or terminal, typeopenssl
-
Set up
OPENSSL_DIRdownload the openssl-dev file and unzip it, you see the files:|__ssl/ |__x64/ |__x86
then export the directory as
OPENSSL_DIRbased on your system. InStart->This Computer->Property(right click) ->Advanced System Setting->Advanced->Environment Variables->New, and typeVariable Value OPENSSL_DIR path/to/x64(for 64-bit system)OPENSSL_DIR path/to/x86(for 32-bit system)then restart the terminal/prompt, and you are ready to go.
Run those examples with:
cd dyer\examples\simple-demo
dyer c
dyer run(or cargo run )
Note that:
- all demos take scraping the quote site as example
- the folder
template, as the name suggests, is a templatedyer-clicreated for illustration. - the folder
dyer-dieselcontainsSQLdatabase(Sqlite, PostGresql, Mysql) integration withdyer-cliviadiesel.