Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate Data for Same Domain #2

Open
MSIH opened this issue Jul 18, 2022 · 1 comment
Open

Aggregate Data for Same Domain #2

MSIH opened this issue Jul 18, 2022 · 1 comment

Comments

@MSIH
Copy link
Collaborator

MSIH commented Jul 18, 2022

The Actor creates a data file for each URL that contains data. If the website has several pages of data then several data files are created for each page.

Create a data file for each domain that contains data for all pages within that domain.

@MSIH
Copy link
Collaborator Author

MSIH commented Jul 18, 2022

loop thru all the data files
if unique create an array using key

let unique = []
let key = "domain"
const { items } = await ResultsDataset.getData();
for (const record of items) {
if(


const jsonDataStorage = await Apify.openKeyValueStore('jsonDataStorage');
await jsonDataStorage.setValue(datasetTitle + 'raw', items)

const lookup = new Map();
for (const record of items) {
 const key = record['placeid'];

 if (!lookup.has(key)) {
 lookup.set(key, record);
 continue;
  }                
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant