Skip to content

Commit d528d9a

Browse files
committed
add x discovery and improve linkedin post description
1 parent bb1a847 commit d528d9a

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
{"name": "web_data_github_repository_file", "description": "Quickly read structured GitHub repository data. Requires a valid GitHub repository file URL. This can be a cache lookup, so it can be more reliable than scraping."},
7979
{"name": "web_data_yahoo_finance_business", "description": "Quickly read structured Yahoo Finance business data. Requires a valid Yahoo Finance business URL. This can be a cache lookup, so it can be more reliable than scraping."},
8080
{"name": "web_data_x_posts", "description": "Quickly read structured X (Twitter) post data. Requires a valid X post URL. This can be a cache lookup, so it can be more reliable than scraping."},
81+
{"name": "web_data_x_profile_posts", "description": "Quickly read structured X (Twitter) posts from a profile. Requires a valid X profile URL (e.g. https://x.com/username). Returns the most recent posts from the profile."},
8182
{"name": "web_data_zillow_properties_listing", "description": "Quickly read structured Zillow properties listing data. Requires a valid Zillow properties listing URL. This can be a cache lookup, so it can be more reliable than scraping."},
8283
{"name": "web_data_booking_hotel_listings", "description": "Quickly read structured Booking.com hotel listings data. Requires a valid Booking hotel listing URL. This can be a cache lookup, so it can be more reliable than scraping."},
8384
{"name": "web_data_youtube_profiles", "description": "Quickly read structured YouTube profiles data. Requires a valid YouTube profile URL. This can be a cache lookup, so it can be more reliable than scraping."},

server.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ const datasets = [{
583583
id: 'linkedin_posts',
584584
dataset_id: 'gd_lyy3tktm25m4avu764',
585585
description: [
586-
'Quickly read structured linkedin posts data',
586+
'Quickly read structured linkedin posts data.',
587+
'Requires a real LinkedIn post URL, for example:',
588+
'linkedin.com/pulse/... or linkedin.com/posts/...',
587589
'This can be a cache lookup, so it can be more reliable than scraping',
588590
].join('\n'),
589591
inputs: ['url'],
@@ -802,6 +804,23 @@ const datasets = [{
802804
'This can be a cache lookup, so it can be more reliable than scraping',
803805
].join('\n'),
804806
inputs: ['url'],
807+
}, {
808+
id: 'x_profile_posts',
809+
dataset_id: 'gd_lwxkxvnf1cynvib9co',
810+
description: [
811+
'Quickly read structured X posts from a profile.',
812+
'Requires a valid X profile URL (e.g. https://x.com/username).',
813+
'Returns the most recent posts from the profile.',
814+
'Optionally filter by date range using start_date and end_date',
815+
'(format: YYYY-MM-DD).',
816+
].join('\n'),
817+
inputs: ['url', 'start_date', 'end_date'],
818+
defaults: {start_date: '', end_date: ''},
819+
trigger_params: {
820+
type: 'discover_new',
821+
discover_by: 'profile_url_most_recent_posts',
822+
limit_per_input: 10,
823+
},
805824
},
806825
{
807826
id: 'zillow_properties_listing',
@@ -867,7 +886,8 @@ const dataset_id_to_title = id=>{
867886
.join(' ');
868887
};
869888

870-
for (let {dataset_id, id, description, inputs, defaults = {}, fixed_values = {}} of datasets)
889+
for (let {dataset_id, id, description, inputs, defaults = {},
890+
fixed_values = {}, trigger_params = {}} of datasets)
871891
{
872892
const tool_name = `web_data_${id}`;
873893
let parameters = {};
@@ -890,7 +910,7 @@ for (let {dataset_id, id, description, inputs, defaults = {}, fixed_values = {}}
890910
data = {...data, ...fixed_values};
891911
let trigger_response = await axios({
892912
url: 'https://api.brightdata.com/datasets/v3/trigger',
893-
params: {dataset_id, include_errors: true},
913+
params: {dataset_id, include_errors: true, ...trigger_params},
894914
method: 'POST',
895915
data: [data],
896916
headers: api_headers(ctx.clientName, tool_name),

tool_groups.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const GROUPS = {
4646
'web_data_tiktok_shop',
4747
'web_data_tiktok_comments',
4848
'web_data_x_posts',
49+
'web_data_x_profile_posts',
4950
'web_data_youtube_profiles',
5051
'web_data_youtube_comments',
5152
'web_data_youtube_videos',

0 commit comments

Comments
 (0)