Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
fix #14 Domain name changed
renamed project to `royalroad-downloader`
  • Loading branch information
Aivean committed Oct 28, 2018
1 parent 46f0a51 commit 34845b6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name := "royalroadl-downloader"
name := "royalroad-downloader"

version := "1.3.1"
version := "2.0.0"

scalaVersion := "2.11.11"

Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[Royal Road](http://royalroadl.com/) book downloader
[Royal Road](http://royalroad.com/) book downloader
---

Nothing fancy, just a simple CLI that imports fiction from [Royal Road](http://royalroadl.com/)
Nothing fancy, just a simple CLI that imports fiction from [Royal Road](http://royalroad.com/)
as html. Use something like [Calibre](http://calibre-ebook.com/) to convert html to any desired format.


How to use
---

* download latest [release .jar](https://github.com/Aivean/royalroadl-downloader/releases/latest)
* download latest [release .jar](https://github.com/Aivean/royalroad-downloader/releases/latest)
* install latest java (maybe you have one, check by executing `java -version`)
* execute `java -jar royalroadl-downloader-assembly-VERSION.jar http://royalroadl.com/fiction/xxxx`
* execute `java -jar royalroad-downloader-assembly-VERSION.jar http://royalroadl.com/fiction/xxxx`
(replace `VERSION` and `xxxx` with corresponding numbers)
* output html file will be created in current directory

Expand All @@ -19,7 +19,7 @@ Troubleshooting
---

1. It may happen that RoyalRoad changes it's html format and this parser is no longer working.
In such case please [create an issue](https://github.com/Aivean/royalroadl-downloader/issues).
In such case please [create an issue](https://github.com/Aivean/royalroad-downloader/issues).
You also can try to work around the problem by overriding [CSS selectors](http://www.w3schools.com/cssref/css_selectors.asp)
that are used to fetch chapter title and body using `-t` and `-b` program arguments.

Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/com/aivean/royalroad/Args.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Args(args: Seq[String]) extends ScallopConf(args) {

banner(
"""Usage:
| [-t css_query_for_title] [-b css_query_for_chapter_body] http://royalroadl.com/fiction/xxxx
| [-t css_query_for_title] [-b css_query_for_chapter_body] https://royalroad.com/fiction/xxxx
|
| Override CSS queries (http://www.w3schools.com/cssref/css_selectors.asp) for title or body
| if RoyalRoad changed it's format and this program works no longer.
Expand All @@ -31,9 +31,9 @@ class Args(args: Seq[String]) extends ScallopConf(args) {
)

val fictionLink = trailArg[String](required = true,
descr = "Fiction URL in format: http://royalroadl.com/fiction/xxxx\n" +
"\tor http[s]://royalroadl.com/fiction/xxxx/fiction-title",
validate = _.matches("https?://(www\\.)?royalroadl.com/fiction/\\d+(/([^/]+)/?)?"))
descr = "Fiction URL in format: http://royalroad.com/fiction/xxxx\n" +
"\tor http[s]://[www.]royalroad.com/fiction/xxxx/fiction-title",
validate = _.matches("https?://(www\\.)?royalroadl?.com/fiction/\\d+(/([^/]+)/?)?"))

verify()
}
4 changes: 2 additions & 2 deletions src/main/scala/com/aivean/royalroad/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ object Main extends App {
| Check $url
| and specify correct css selector for $name as command line argument for this program.
| Check readme or run this program with --help parameter for details:
| https://github.com/Aivean/royalroadl-downloader/blob/master/readme.md
| https://github.com/Aivean/royalroad-downloader/blob/master/readme.md
| Css selectors reference: http://www.w3schools.com/cssref/css_selectors.asp
""".stripMargin)
}

val chapUrls = {
val urls = threads.collect {
case x if x.startsWith("/") => "https://www.royalroadl.com" + x
case x if x.startsWith("/") => "https://www.royalroad.com" + x
case x => x
}.par

Expand Down

0 comments on commit 34845b6

Please sign in to comment.