You have read_doc from Day 20. Your advisor suggests sharing thesis milestones on LinkedIn. How do you turn a Google Doc's title into a post?
Call read_doc with the doc ID, extract the title, write a short post template with the title, then call LINKEDIN_CREATE_LINKED_IN_POST with that text.
Exactly right. The doc title becomes the headline of the post. LinkedIn's LINKEDIN_CREATE_LINKED_IN_POST action takes a text param — the post body:
def doc_to_post(doc_id: str) -> dict:
doc = read_doc(doc_id)
title = doc.get("title", "Research update")
text = f"New thesis milestone: {title}\n\nSharing my research progress. #thesis #research"
result = toolset.execute_action(
Action.LINKEDIN_CREATE_LINKED_IN_POST,
{"text": text}
)
print(f"Posted: {title}")
return resultDoes LINKEDIN_CREATE_LINKED_IN_POST need any other params besides text?
Just text for a basic public post. The action handles authentication and formatting. For visibility settings or media attachments you'd need additional params — but for a plain text post, text is sufficient:
def doc_to_post(doc_id: str) -> dict:
doc = read_doc(doc_id)
title = doc.get("title", "Research update")
text = (
f"New thesis milestone: {title}\n\n"
"Sharing research progress from my current study. "
"#thesis #research #academia"
)
result = toolset.execute_action(
Action.LINKEDIN_CREATE_LINKED_IN_POST,
{"text": text}
)
print(f"Posted LinkedIn update: {title}")
return resultI can run this every time I finish a new doc section — my LinkedIn feed becomes a research diary.
The cross-app pattern is the same: read one app, extract a key, write to another. What changes is the namespace: GOOGLEDOCS_ → LINKEDIN_. The sequencing logic is identical to every other workflow this week.
The doc ID is the only argument. The title is already in the doc — I don't have to pass it as a separate parameter. The function is clean.
Right. The function encapsulates the full transformation: ID in, post out. The caller doesn't need to know how LinkedIn's action is named or what parameters it takes.
read_doc(doc_id) → extract title → LINKEDIN_CREATE_LINKED_IN_POST with text
doc.get('title', 'Research update') — the document title. Use a fallback string so the post is never empty even if the doc has no title set.
Action.LINKEDIN_CREATE_LINKED_IN_POST takes a single text param (the post body as a plain string). For a basic public post no other params are required.
Build the post with an f-string: opening line with the title, then hashtags on a second line. Keep the post under 700 characters to stay within LinkedIn's character limit for plain posts.
You have read_doc from Day 20. Your advisor suggests sharing thesis milestones on LinkedIn. How do you turn a Google Doc's title into a post?
Call read_doc with the doc ID, extract the title, write a short post template with the title, then call LINKEDIN_CREATE_LINKED_IN_POST with that text.
Exactly right. The doc title becomes the headline of the post. LinkedIn's LINKEDIN_CREATE_LINKED_IN_POST action takes a text param — the post body:
def doc_to_post(doc_id: str) -> dict:
doc = read_doc(doc_id)
title = doc.get("title", "Research update")
text = f"New thesis milestone: {title}\n\nSharing my research progress. #thesis #research"
result = toolset.execute_action(
Action.LINKEDIN_CREATE_LINKED_IN_POST,
{"text": text}
)
print(f"Posted: {title}")
return resultDoes LINKEDIN_CREATE_LINKED_IN_POST need any other params besides text?
Just text for a basic public post. The action handles authentication and formatting. For visibility settings or media attachments you'd need additional params — but for a plain text post, text is sufficient:
def doc_to_post(doc_id: str) -> dict:
doc = read_doc(doc_id)
title = doc.get("title", "Research update")
text = (
f"New thesis milestone: {title}\n\n"
"Sharing research progress from my current study. "
"#thesis #research #academia"
)
result = toolset.execute_action(
Action.LINKEDIN_CREATE_LINKED_IN_POST,
{"text": text}
)
print(f"Posted LinkedIn update: {title}")
return resultI can run this every time I finish a new doc section — my LinkedIn feed becomes a research diary.
The cross-app pattern is the same: read one app, extract a key, write to another. What changes is the namespace: GOOGLEDOCS_ → LINKEDIN_. The sequencing logic is identical to every other workflow this week.
The doc ID is the only argument. The title is already in the doc — I don't have to pass it as a separate parameter. The function is clean.
Right. The function encapsulates the full transformation: ID in, post out. The caller doesn't need to know how LinkedIn's action is named or what parameters it takes.
read_doc(doc_id) → extract title → LINKEDIN_CREATE_LINKED_IN_POST with text
doc.get('title', 'Research update') — the document title. Use a fallback string so the post is never empty even if the doc has no title set.
Action.LINKEDIN_CREATE_LINKED_IN_POST takes a single text param (the post body as a plain string). For a basic public post no other params are required.
Build the post with an f-string: opening line with the title, then hashtags on a second line. Keep the post under 700 characters to stay within LinkedIn's character limit for plain posts.
Create a free account to get started. Paid plans unlock all tracks.