public void map(Object key, Text value, Context context)
            throws IOException, InterruptedException {
        String url = value.toString().split("\\s+")[0].trim();

        try {

            if (isValidLink(url)) {

                Document document = Jsoup.connect(url).userAgent("Mozilla").get();
                TutByNewsAdapter adapter = new TutByNewsAdapter(document);
                if (adapter.isArticlePresent()) {
                    writeArticle(url, adapter);
                }
                Elements allLinks = document.select("body a");
                for (Element a : allLinks) {
                    String urlToWrite = a.attr("abs:href");

                    if (isValidLink(urlToWrite) && isLinkToInternalPage(urlToWrite, url)) {
                        newLink.set(urlToWrite);
                        context.write(newLink, one);
                    }
                }
            }
        }
        catch (Exception e) {
            LOGGER.severe(String.format("%s: %s", e.getClass().getName(), e.getMessage()));
        }
    }