问题描述
exports.createPages = async ({ graphql,actions }) => {
const {
data: {
pageMetadata,pageData,}
} = await graphql(`
{
pageMetadata: allProductsJson {
nodes {
slug
metadata {
title
description
image {
publicURL
}
robots
}
}
}
pageData: allPageJson {
pages: {
slug
}
}
}
`
// for each page
pageData.pages.map(({ slug }) => {
// select the metadata with the matching slug
const { metadata } = pageMetadata.nodes.find(node => node.slug === slug)
// create the page
actions.createPage({
path: `/${slug}/`,component: `./src/templates/page.jsx`,context: {
// pass both the slug and metadata as context
slug,metadata,}
})
})
}
这段代码需要花费大量时间才能执行,并且使我获得10,600条推文,其中大多数没有任何价值。我只需要转发或喜欢大于阈值的推文。不幸的是,关于twint和getoldtweets3的文档非常少。请问有人对此有任何经验吗?
解决方法
试试这个代码
c.Lang = "en"
c.Search = "TSLA"
StartDate = "2019-10-01"
EndDate = "2019-10-10"
c.Since = StartDate
c.Until = EndDate
c.Filter_retweets = True
c.Store_csv = True
c.min_likes = 5