Popularity
1.1
Stable
Activity
0.0
Stable
9
2
0

Programming language: Go
License: GNU General Public License v3.0 only
Tags: HTML     Bot     Utility     Text Processing     Scraping    

Bookgot alternatives and similar packages

Based on the "Utility" category.
Alternatively, view Bookgot alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Bookgot or a related project?

Add another 'Utility' Package

README

Bookgot

BookGot is a simple boot for farm free books from PACKTPUB.COM

Install

go get -u github.com/bregydoc/Bookgot

Usage

First import BookGot

//...
import "github.com/bregydoc/Bookgot"

Second create a User for Login in PackPub

user := Bookgot.CreateNewPBUser("[email protected]", "password")
ok := user.Login()
if ok && user.Logged{
    fmt.Println("User logged!")
}

For verify if the user have the last free book from PacktPub.com

//...
if ok := user.VerifyIfIHaveLastFreeBook(); ok{
    fmt.Println("You are up to day")
}

If VerifyIfIHaveLastFreeBook() return false is because PackPub have a new free book and you not claim this. You can know the name of the current free book

//...
if ok := user.PullNewFreeBook(); ok{
    fmt.Println("Ok, you have the last free book")
}

If you want to know the list of books in your account, you can use the GetNamesOfBooks() function

//...
user := Bookgot.CreateNewPBUser("[email protected]","password")
books := user.GetNamesOfBooks()
for i, book := range books{
    fmt.Println("Book ", i , " : ", book)
}

Other functions

Return the name of last free book in PackPub.com

//...
name := Bookgot.GetNameOfCurrentFreeBook()
fmt.Println(name)

Return the time left for update the free book

//...
timeLeft, _ := Bookgot.GetTimeForNewFreeBook()
fmt.Println(timeLeft.String())

Example for create a complete bot

package main

import(
    "github.com/bregydoc/Bookgot"
    "fmt"
)

func main() {
    userExample := Bookgot.CreateNewPBUser("[email protected]", "password")
    if userExample.Login() {
        fmt.Println("Logged!")
    }
    for {
        haveNewBook := userExample.VerifyIfIHaveLastFreeBook()

        if haveNewBook{
            haveNewBook = userExample.VerifyIfIHaveLastFreeBook()
            timeAfter, _ := Bookgot.GetTimeForNewFreeBook()
            fmt.Println("Not new free book, time for next book: ", timeAfter.String())
        }else {
            petition :=  userExample.PullNewFreeBook()
            if petition{
                fmt.Println("New free book added at your library")
            }else{
                fmt.Println("Error, verify your email and password")
            }
        }

    }

}