基本大纲;我正在检索约 100 个 Facebook 状态,并搜索这些帖子以检查它是否包含约 20 个搜索词之一。当我尝试在浏览器中运行它时,它会锁定,这让我担心尝试在客户端运行它。
让服务器运行此操作并返回结果的最简单方法是什么?我可以用 Python 做吗?这是循环,供参考。
function Filter() {
console.log("running Filter")
//loop through fbObj.posts
for (i = 0, l = fbObj.length; i < l; i++){
var post = fbObj[i].post
console.log("Checking " + post + " for search terms")
//loop through searchTerms
for (j = 0; j<searchTermObj.length; j= j++) {
searchTerm_variants = searchTermObj[j].words
for (x = 0; x < searchTerm_variants.length; x++){
if (post.indexOf(searchTerm_variants[x]) !== 0){
foundPosts[i] = {}
foundPosts[i] = fbObj[i]
}
}
}
console.log(foundPosts)
}
}