Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit 52c8c8f

Browse files
TonyRLCopilot
andauthored
feat(pinterest): add pinterest (DIYgod#17747)
* feat(pinterest): add Pinterest * Update lib/routes/pinterest/user.ts * Update lib/routes/pinterest/types.ts --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 71af316 commit 52c8c8f

3 files changed

Lines changed: 441 additions & 0 deletions

File tree

lib/routes/pinterest/namespace.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { Namespace } from '@/types';
2+
3+
export const namespace: Namespace = {
4+
name: 'Pinterest',
5+
url: 'www.pinterest.com',
6+
lang: 'en',
7+
};

lib/routes/pinterest/types.ts

Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
export interface BoardsFeedResource {
2+
node_id: string;
3+
name: string;
4+
created_at: string;
5+
section_count: number;
6+
images: BoardImages;
7+
image_cover_hd_url: string;
8+
archived_by_me_at: null;
9+
access: any[];
10+
image_cover_url: string;
11+
follower_count: number;
12+
event_date: null;
13+
should_show_shop_feed: boolean;
14+
should_show_board_collaborators: boolean;
15+
collaborator_requests_enabled: boolean;
16+
is_temporarily_disabled: boolean;
17+
collaborating_users: any[];
18+
followed_by_me: boolean;
19+
viewer_collaborator_join_requested: boolean;
20+
cover_pin: CoverPin;
21+
place_saves_count: number;
22+
board_order_modified_at: string;
23+
owner: Owner;
24+
allow_homefeed_recommendations: boolean;
25+
pin_count: number;
26+
collaborator_count: number;
27+
has_custom_cover: boolean;
28+
privacy: string;
29+
should_show_more_ideas: boolean;
30+
event_start_date: null;
31+
url: string;
32+
collaborated_by_me: boolean;
33+
is_collaborative: boolean;
34+
cover_images: CoverImages;
35+
is_ads_only: boolean;
36+
type: string;
37+
description: string;
38+
}
39+
40+
interface BoardImages {
41+
'170x': ImageItem[];
42+
}
43+
44+
interface Images {
45+
orig: ImageItem;
46+
[x: string]: ImageItem;
47+
}
48+
49+
interface ImageItem {
50+
url: string;
51+
width: number;
52+
height: number;
53+
dominant_color: string;
54+
}
55+
56+
interface CoverPin {
57+
pin_id: string;
58+
timestamp: number;
59+
image_signature: string;
60+
crop?: number[];
61+
size?: number[];
62+
scale?: number;
63+
image_url?: string;
64+
custom_cover?: boolean;
65+
image_size?: number[] | null;
66+
}
67+
68+
interface Owner {
69+
node_id: string;
70+
explicitly_followed_by_me: boolean;
71+
is_partner: boolean;
72+
is_ads_only_profile: boolean;
73+
is_private_profile: boolean;
74+
ads_only_profile_site: null;
75+
domain_verified: boolean;
76+
type: string;
77+
image_medium_url: string;
78+
is_default_image: boolean;
79+
id: string;
80+
full_name: string;
81+
username: string;
82+
is_verified_merchant: boolean;
83+
verified_identity: object;
84+
}
85+
86+
interface Pinner extends Owner {
87+
image_large_url: string;
88+
image_small_url: string;
89+
}
90+
91+
interface CoverImages {
92+
'200x150': ImageItem;
93+
'222x': ImageItem;
94+
}
95+
96+
export interface UserActivityPinsResource {
97+
node_id: string;
98+
is_stale_product: boolean;
99+
attribution: null;
100+
access: any[];
101+
images: Images;
102+
comment_count: number;
103+
digital_media_source_type: null;
104+
promoted_is_removable: boolean;
105+
is_eligible_for_pdp: boolean;
106+
sponsorship: null;
107+
story_pin_data_id: string;
108+
description_html: string;
109+
shopping_flags: any[];
110+
is_uploaded: boolean;
111+
campaign_id: null;
112+
is_playable: boolean;
113+
manual_interest_tags: null;
114+
video_status: null;
115+
seo_url: string;
116+
image_signature: string;
117+
is_eligible_for_web_closeup: boolean;
118+
ad_match_reason: number;
119+
is_oos_product: boolean;
120+
dominant_color: string;
121+
aggregated_pin_data: AggregatedPinData;
122+
creator_analytics: null;
123+
is_repin: boolean;
124+
done_by_me: boolean;
125+
board: Board;
126+
view_tags: any[];
127+
video_status_message: null;
128+
description: string;
129+
domain: string;
130+
is_downstream_promotion: boolean;
131+
is_video: boolean;
132+
promoter: null;
133+
embed: null;
134+
comments: Comments;
135+
collection_pin: null;
136+
is_promoted: boolean;
137+
grid_title: string;
138+
is_whitelisted_for_tried_it: boolean;
139+
promoted_is_lead_ad: boolean;
140+
debug_info_html: null;
141+
link: null;
142+
is_native: boolean;
143+
id: string;
144+
promoted_lead_form: null;
145+
type: string;
146+
rich_summary: null;
147+
title: string;
148+
alt_text: null;
149+
created_at: string;
150+
is_quick_promotable: boolean;
151+
pinner: Pinner;
152+
image_crop: ImageCrop;
153+
reaction_counts: object;
154+
tracking_params: string;
155+
is_eligible_for_related_products: boolean;
156+
product_pin_data: null;
157+
privacy: string;
158+
price_currency: string;
159+
has_required_attribution_provider: boolean;
160+
seo_title: string;
161+
price_value: number;
162+
insertion_id: null;
163+
seo_noindex_reason: null;
164+
carousel_data: null;
165+
videos: null;
166+
story_pin_data: StoryPinData;
167+
grid_description: string;
168+
repin_count: number;
169+
native_creator: Owner;
170+
should_open_in_stream: boolean;
171+
additional_hide_reasons: any[];
172+
method: string;
173+
}
174+
175+
interface AggregatedPinData {
176+
node_id: string;
177+
is_shop_the_look: boolean;
178+
aggregated_stats: AggregatedStats;
179+
did_it_data: DidItData;
180+
creator_analytics: null;
181+
has_xy_tags: boolean;
182+
id: string;
183+
}
184+
185+
interface AggregatedStats {
186+
saves: number;
187+
done: number;
188+
}
189+
190+
interface DidItData {
191+
type: string;
192+
details_count: number;
193+
recommend_scores: RecommendScore[];
194+
rating: number;
195+
tags: any[];
196+
user_count: number;
197+
videos_count: number;
198+
images_count: number;
199+
recommended_count: number;
200+
responses_count: number;
201+
}
202+
203+
interface RecommendScore {
204+
score: number;
205+
count: number;
206+
}
207+
208+
interface Board {
209+
node_id: string;
210+
layout: string;
211+
type: string;
212+
privacy: string;
213+
followed_by_me: boolean;
214+
image_thumbnail_url: string;
215+
name: string;
216+
collaborated_by_me: boolean;
217+
owner: Owner;
218+
is_collaborative: boolean;
219+
url: string;
220+
id: string;
221+
}
222+
223+
interface Comments {
224+
uri: string;
225+
data: any[];
226+
bookmark: null;
227+
}
228+
229+
interface ImageCrop {
230+
min_y: number;
231+
max_y: number;
232+
}
233+
234+
interface StoryPinData {
235+
node_id: string;
236+
page_count: number;
237+
type: string;
238+
has_affiliate_products: boolean;
239+
static_page_count: number;
240+
pages: Page[];
241+
metadata: Metadata;
242+
is_deleted: boolean;
243+
total_video_duration: number;
244+
pages_preview: PagePreview[];
245+
has_product_pins: boolean;
246+
id: string;
247+
last_edited: null;
248+
}
249+
250+
interface Page {
251+
blocks: Block[];
252+
}
253+
254+
interface Block {
255+
type: string;
256+
block_type: number;
257+
text: string;
258+
block_style: BlockStyle;
259+
image_signature: string;
260+
image: null;
261+
tracking_id: string;
262+
}
263+
264+
interface BlockStyle {
265+
x_coord: number;
266+
corner_radius: number;
267+
rotation: number;
268+
height: number;
269+
width: number;
270+
y_coord: number;
271+
}
272+
273+
interface Metadata {
274+
basics: null;
275+
is_compatible: boolean;
276+
root_user_id: string;
277+
canvas_aspect_ratio: number;
278+
diy_data: null;
279+
compatible_version: string;
280+
is_editable: boolean;
281+
root_pin_id: string;
282+
pin_title: string | null;
283+
template_type: null;
284+
showreel_data: null;
285+
recipe_data: null;
286+
is_promotable: boolean;
287+
version: string;
288+
pin_image_signature: string;
289+
}
290+
291+
interface PagePreview {
292+
blocks: Block[];
293+
}
294+
295+
export interface UserProfile extends Owner {
296+
image_xlarge_url: string;
297+
impressum_url: null;
298+
seo_canonical_domain: string;
299+
following_count: number;
300+
last_pin_save_time: string;
301+
first_name: string;
302+
eligible_profile_tabs: EligibleProfileTab[];
303+
seo_noindex_reason: null;
304+
board_count: number;
305+
instagram_data: null;
306+
profile_cover: ProfileCover;
307+
seo_description: string;
308+
follower_count: number;
309+
interest_following_count: null;
310+
is_inspirational_merchant: boolean;
311+
about: string;
312+
partner: null;
313+
website_url: null;
314+
domain_url: null;
315+
seo_title: string;
316+
indexed: boolean;
317+
is_primary_website_verified: boolean;
318+
}
319+
320+
interface EligibleProfileTab {
321+
id: string;
322+
type: string;
323+
tab_type: number;
324+
name: string;
325+
is_default: boolean;
326+
}
327+
328+
interface ProfileCover {
329+
id: string;
330+
}

0 commit comments

Comments
 (0)