index.js
function scrapeAll(query, scrapeDetails) {

    return co(function *() {
        //By default, scrape the card details
        scrapeDetails = scrapeDetails === undefined ? true : scrapeDetails;

        //Load the HTML page
        const scrapeURL = makeUrl(SCRAPE_URL, query);
        const search = yield scrapeSearchPage(scrapeURL);

        //Recurring variables
        var cards = search.cards;
        var i;

        //Scrape all of the pages sequentially;
        for (i = 2; i <= search.numPages; i++) {
            const scrapeURL = makeUrl(Url.resolve(SCRAPE_URL, i.toString()), query);
            const results = yield scrapeSearchPage(scrapeURL);
            cards = cards.concat(results.cards);
        }

        //Scrape all of the cards sequentially if requested
        if (scrapeDetails) {
            for (i = 0; i < cards.length; i++) {
                const card = cards[i];
                _.assign(card, yield scrapeCard(card.url));
            }
        }

        return cards;
    })();
}
function scrapeAll(query, scrapeDetails) {

    return co(function *() {
        //By default, scrape the card details
        scrapeDetails = scrapeDetails === undefined ? true : scrapeDetails;

        //Load the HTML page
        const scrapeURL = makeUrl(SCRAPE_URL, query);
        const search = yield scrapeSearchPage(scrapeURL);

        //Recurring variables
        var cards = search.cards;
        var i;

        //Scrape all of the pages sequentially;
        for (i = 2; i <= search.numPages; i++) {
            const scrapeURL = makeUrl(Url.resolve(SCRAPE_URL, i.toString()), query);
            const results = yield scrapeSearchPage(scrapeURL);
            cards = cards.concat(results.cards);
        }

        //Scrape all of the cards sequentially if requested
        if (scrapeDetails) {
            for (i = 0; i < cards.length; i++) {
                const card = cards[i];
                _.assign(card, yield scrapeCard(card.url));
            }
        }

        return cards;
    })();
}
function scrapeAll ( query , scrapeDetails ) { return co ( function * ( ) { //By default, scrape the card details scrapeDetails = scrapeDetails === undefined ? true : scrapeDetails ; //Load the HTML page const scrapeURL = makeUrl ( SCRAPE_URL , query ) ; const search = yield scrapeSearchPage ( scrapeURL ) ; //Recurring variables var cards = search . cards ; var i ; //Scrape all of the pages sequentially; for ( i = 2 ; i <= search . numPages ; i ++ ) { const scrapeURL = makeUrl ( Url . resolve ( SCRAPE_URL , i . toString ( ) ) , query ) ; const results = yield scrapeSearchPage ( scrapeURL ) ; cards = cards . concat ( results . cards ) ; } //Scrape all of the cards sequentially if requested if ( scrapeDetails ) { for ( i = 0 ; i < cards . length ; i ++ ) { const card = cards [ i ] ; _ . assign ( card , yield scrapeCard ( card . url ) ) ; } } return cards ; } ) ( ) ; }
Scrapes the Pokemon TCG database
@param query The query string to use for the search.
@param scrapeDetails True if you want to return the card data, false if you just want the URLs
@returns {*}
Scrapes the Pokemon TCG database