Goal:
Automate the collection of relevant news and videos on selected topics by creating and publishing a personalized content feed to your mini-site.
Scope of application:
For this automation, you will need the following services:
First of all, install the API keys and connect your credentials in OpenAI
Next, connect your credentials to the Pinecone vector store
To do this, go to the indexes section and click Create index, then give a name and select in configuration: text-embedding-3-small
Then go to the section: API keys and create a new API key
And then paste the api key into n8n
Next, connect your API key to Tavily
https://app.tavily.com/home
And paste to the right of the word Bearer
In the Get 1 Video and Get Channel ID nodes, connect your OAuth credentials that we used to connect Google Drive in past automations. Just before that, go to https://console.cloud.google.com/marketplace/product/google/youtube.googleapis.com?q=search&referrer=search&authuser=1&inv=1&invt=AbwHvg&project=astute-expanse-457620-b7 and click Enable API to activate the YouTube API.
Now, in the Transcribe node, connect the API key from the RapidAPI service
You will see a page like this
Here, copy and paste data from 'x-rapidapi-host: and 'x-rapidapi-key into n8n:
Next, connect Supabase
Go and sign in to your account https://supabase.com/dashboard/
Create a new organization and a new project
Then go to the SQL Editor section
And then enter the following commands:
CREATE TABLE public.news (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
title TEXT NOT NULL,
content TEXT NOT NULL,
type TEXT DEFAULT 'general',
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now ()
);
CREATE TABLE public.completed (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
title TEXT NOT NULL,
content TEXT NOT NULL,
type TEXT DEFAULT 'general',
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now ()
);
CREATE TABLE public.webhooks (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
name TEXT NOT NULL,
webhook_url TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now ()
);
CREATE TABLE public.chat_options (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
name TEXT NOT NULL,
chat_text TEXT NOT NULL,
chat_query TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now ()
);
CREATE OR REPLACE FUNCTION public.delete_news_item (item_id uuid)
RETURNS boolean
LANGUAGE plpgsql
SECURITY DEFINER
AS $function$
DECLARE
deleted_count INTEGER;
BEGIN
DELETE FROM public.news
WHERE id = item_id
RETURNING 1 INTO deleted_count;
-- Return true if one or more rows were deleted
RETURN COALESCE (deleted_count, 0) > 0;
END;
$function$;
CREATE OR REPLACE FUNCTION delete_rows ()
RETURNS BOOLEAN AS $function$
DECLARE
deleted_count INTEGER;
BEGIN
-- Example deletion (replace with your actual DELETE statement)
DELETE FROM some_table WHERE some_condition;
GET DIAGNOSTICS deleted_count = ROW_COUNT;
-- Return true if one or more rows were deleted
RETURN COALESCE (deleted_count, 0) > 0;
END;
$function$ LANGUAGE plpgsql;
Now set up an external site where everything will be displayed
Go to https://lovable.dev/projects/ed99ca42-7ba8-46ef-835e-ee12a96f5ab8
And click the Remix it button at the top right
Click on the green SupAbase icon
And connect your Supabase account
Also, in n8n in the SupAbase node, make sure that you have the completed table in the Table Name or ID section. After automation is triggered, data will be downloaded and displayed on the site.
You can also customize the topics you need to search for news and videos in these two nodes:
It's done.
Automation now works in conjunction with your site and publishes the news feed right there.
You can always get a JSON file and instructions in video format by joining our unique Automation club.