lib/fetching/channels/crowdtangle.js
/**
     * Overrides the CrowdTangleChannel `fetchPage` function.
     */
Overrides the CrowdTangleChannel `fetchPage` function.
Overrides the CrowdTangleChannel ` fetchPage ` function .
async fetchPage() {
        this.listPair = await this.readListPair();
        const { crowdtangle_saved_searches: savedSearches } = this.listPair;
        const savedSearchIds = Object.keys(savedSearches).join(",");
        if (this.savedSearchToggle) {
            this.queryParams = {
                ...this.queryParams,
                listIds: savedSearchIds, 
            };
        } else {
            this.queryParams = {
                ...this.queryParams,
                listIds: undefined, 
            };
        }
        const posts = await super.fetchPage();
        posts.forEach((post) => this.addCrowdTangleTags(post));
        this.savedSearchToggle = !this.savedSearchToggle;
        return posts;
    }
async fetchPage ( ) { this . listPair = await this . readListPair ( ) ; const { crowdtangle_saved_searches : savedSearches } = this . listPair ; const savedSearchIds = Object . keys ( savedSearches ) . join ( "," ) ; if ( this . savedSearchToggle ) { this . queryParams = { ... this . queryParams , listIds : savedSearchIds , } ; } else { this . queryParams = { ... this . queryParams , listIds : undefined , } ; } const posts = await super . fetchPage ( ) ; posts . forEach ( ( post ) => this . addCrowdTangleTags ( post ) ) ; this . savedSearchToggle = ! this . savedSearchToggle ; return posts ; }
Overrides the CrowdTangleChannel `fetchPage` function.
Overrides the CrowdTangleChannel ` fetchPage ` function .
// Saved Searches // Lists