Save tweets matching a search term to an Algolia index
@dylan
code:
data:privatelast updated:3 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 800,000+ developers using the Pipedream platform
steps.
trigger
active
last updated:-last event:-
steps.
add_objects_to_index
Adds an array of JavaScript objects to the given index
auth
(auths.algolia)
params
Index

The name of your Algolia index

 
string ·params.index
Objects

An array of JavaScript objects, each corresponding to a new object in your search index. It's recommended you create this array of objects in a prior code step, then select expression mode and enter a variable reference to that array here.

[0]:
{{event}}
array ·params.objects
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
}
10
const algoliasearch = require("algoliasearch");
 
const client = algoliasearch(auths.algolia.application_id, auths.algolia.api_key);
const index = client.initIndex(params.index);
 
this.objectIds = await index.saveObjects(params.objects, {
  autoGenerateObjectIDIfNotExist: params.autoGenerateObjectIDIfNotExist || true 
})