Team Ai
Apppublic

Coding-With-Raptor/Likendin-Agent

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
linkedin_posts.cpython-313.pyc26 linesDownload Raw Back to __pycache__
1�

2��Rhe	��|�SSKJr SSKrSSKJrJr SSKrSr\"\"55 S\3SS.rSr	\S	\34S4j5rg)�)�
function_toolN)�find_dotenv�load_dotenva^AQXDALy5SlRU2h8GaK5Dr3bP6k0fTpx_eDWAoLXrEJZXeFmOaldcyM1ewqEKozVe3umTODdEzQSoN8JlPrUMuISXUvUKdljgrK1nfsykMKZybDza-6ngfX1BInZ-k0ui-EzfLlxTwJMu7WrjQjlNUw_GzM-wWO6hhta3F_DdRqa5DCEhc-e7XYHE4xYfx9K3945jINGWPga1O8oWak4tr0qSMbaRY3BTJ28b-NJzihUvvKlktJvKsZb_h1sjcfV5FBuPqHLH9zUXR5V7t5nXog7OlbZ5NyGx3GR0zWHmkv7QitrPCCemxpsoQ98b5e9VaYm9HjU_2RwfAswkVUGowxzuhHtfnwzBearer zapplication/json)�
AuthorizationzContent-Typec���Sn[R"U[S9nUR5 UR	5$![R5Ran[SU35 SnAgSnAff=f)z�6Retrieve LinkedIn user profile information using the /userinfo endpoint.7 8Returns:9    dict: User profile information or None if an error occurs.10z$https://api.linkedin.com/v2/userinfo)�headerszError fetching user info: N)�requests�get�HEADERS�raise_for_status�json�11exceptions�RequestException�print)�url�response�es   �@d:\My Own Project\linkedin-agent\backend\tools\linkedin_posts.py�get_user_idrse��1�C���<�<��W�5���!�!�#��}�}�������/�/��
�*�1�#�.�/����s�8=�A3�A.�.A3�contentc�X�[5nU(d[S5 gSUS3nSnUSSSU0S	S12.0SS0S
.n[R"U[US9nUR5 UR
5$![RRan[SU35 SnAgSnAff=f)z�13Share content on LinkedIn.14 15Args:16    params (RunContextWrapper[PostContentParams]): Parameters for the post.17 18Returns:19    dict: API response or None if an error occurs.20z$Failed to retrieve user information.Nzurn:li:person:�subz$https://api.linkedin.com/v2/ugcPosts�	PUBLISHEDzcom.linkedin.ugc.ShareContent�text�NONE)�shareCommentary�shareMediaCategoryz(com.linkedin.ugc.MemberNetworkVisibility�PUBLIC)�author�lifecycleState�specificContent�21visibility)rr
zError posting content: )	rrr	�postrrr
rr)r�	user_info�22author_urnr�payloadrrs       r�post_content_linkedinr'&s����
�I��
�4�5��!�)�E�"2�!3�4�J�230�C��%�+�$*�G�#4�&,�.�24�B�8�L�25�G���=�=��g�G�D���!�!�#��}�}�������/�/��
�'��s�+�,����s�9A3�3B)�B$�$B))�agentsrr	�dotenvrr�os�LINKEDIN_ACCESS_TOKENrr�strr'��r�<module>r/s^�� ��+�	�w��26�K�M���4�5�6�&����&�#�3�#��#r.