Skip to content

Commit

Permalink
updated descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
laureanray committed Jun 23, 2022
1 parent d90a0f1 commit fdafd3c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
13 changes: 5 additions & 8 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ import (

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "genread-api",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Use: "clibgen",
Short: "library gensis command line / terminal client",
Long: `
clibgen is a CLI application to search and download epubs, pdfs, from library genesis.
Useful if you are lazy to open up a browser to download e-books/resources.'`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand Down
11 changes: 4 additions & 7 deletions cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ import (
// searchCmd represents the search command
var searchCmd = &cobra.Command{
Use: "search",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Short: "library gensis command line / terminal client",
Long: `
clibgen is a CLI application to search and download epubs, pdfs, from library genesis.
Useful if you are lazy to open up a browser to download e-books/resources.'`,
Run: func(cmd *cobra.Command, args []string) {
books, err := api.SearchBookByTitle(args[0], 5)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/book.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ type Book struct {
Extension string `json:"extension"`
Mirrors []string `json:"mirrors"`
}

type BookService interface{}
3 changes: 1 addition & 2 deletions pkg/api/libgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func getLinkFromDocument(document *goquery.Document) (string, bool) {
}

func getDirectDownloadLink(link string) string {
log.Println("Downloading book ", link)
log.Println("Downloading book from: ", link)

resp, err := http.Get(link)

Expand Down Expand Up @@ -110,7 +110,6 @@ func getDirectDownloadLink(link string) string {
return ""
}

// TODO: Introduce proper types with pagination
func SearchBookByTitle(query string, limit int) ([]Book, error) {
var e error
queryString := fmt.Sprintf("https://libgen.is/search.php?req=%s&res=25&view=simple&phrase=1&column=def", url.QueryEscape(query))
Expand Down

0 comments on commit fdafd3c

Please sign in to comment.