Skip to content

Instantly share code, notes, and snippets.

package bookstore.scraper.book.scrapingtypeservice;
import bookstore.scraper.book.Book;
import bookstore.scraper.dataprovider.EmpikBookProvider;
import bookstore.scraper.dataprovider.MerlinBookProvider;
import bookstore.scraper.enums.Bookstore;
import bookstore.scraper.fetcher.empik.EmpikFetchingBookService;
import bookstore.scraper.fetcher.merlin.MerlinFetchingBookService;
import bookstore.scraper.urlproperties.EmpikUrlProperties;
import bookstore.scraper.urlproperties.MerlinUrlProperties;
package bookstore.scraper.fetcher.empik;
import bookstore.scraper.book.Book;
import bookstore.scraper.urlproperties.EmpikUrlProperties;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
private Map<Bookstore, List<Book>> chooseGetterImplementationByCategory(CategoryType categoryType) {
String URL = "";
if (categoryType.equals(CategoryType.CRIME))
URL =
if (categoryType.equals(CategoryType.ROMANCES))
URL =
if (categoryType.equals(CategoryType.FANTASY))
URL =
if (categoryType.equals(CategoryType.GUIDES))
Map<String,String> createCategoryWithCorrespondingURL()
{
Map<String, String> categoryToMarlinURL = new HashMap<>();
categoryToMarlinURL.put("horror", merlinUrlProperties.getMerlin().getHorror());
categoryToMarlinURL.put("drama", merlinUrlProperties.getMerlin().getDrama());
...
return categoryTomarlinURL;
}
package bookstore.scraper.test;
import bookstore.scraper.book.Book;
import bookstore.scraper.enums.Bookstore;
import bookstore.scraper.enums.CategoryType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
package bookstore.scraper.urlproperties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Getter
@Setter
@Component
package bookstore.scraper.book.booksource.empik;
import bookstore.scraper.book.Book;
import bookstore.scraper.book.booksource.BookServiceSource;
import bookstore.scraper.enums.Bookstore;
import bookstore.scraper.enums.CategoryType;
import bookstore.scraper.urlproperties.EmpikUrlProperties;
import bookstore.scraper.utilities.JSoupConnector;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;