-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclipee_linkedin.py
61 lines (43 loc) · 1.93 KB
/
clipee_linkedin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## 2024-05-01 20:46 moved to Linkedinee ConnecteeOne
# # Mark as Connected in DB from Linkedin link
# # Use with Alfred as CL = "Connected on Linkedin"
# from datetime import datetime
# import subprocess
# from pync import Notifier
# from DB.tools import select_all_records, update_record
# import os
# import my_utils
# from dotenv import load_dotenv
# load_dotenv()
# # PATH_QUEUE_AI_FILE = os.getenv("PATH_QUEUE_AI_FILE")
# DB = os.getenv("DB_BTOB")
# clipboard_content = subprocess.check_output(['pbpaste']).decode('utf-8')
# all_people_by_linkedin_handle = {my_utils.linkedin_handle_from_url(x.linkedin):x.rowid for x in select_all_records(DB, 'people') if x.linkedin}
# table_name = 'people'
# try:
# if clipboard_content.startswith('https://www.linkedin.com'):
# linkedin_handle = my_utils.linkedin_handle_from_url(clipboard_content)
# print(f"\n{linkedin_handle=}\n")
# rowid = all_people_by_linkedin_handle[linkedin_handle]
# print(f"\n{rowid=}\n")
# updating_record = update_record(DB, table_name, {
# 'rowid': rowid,
# 'visited': f"{datetime.now().strftime('%Y-%m-%d %H:%M')}",
# 'connected': f"{datetime.now().strftime('%Y-%m-%d')} pending",
# 'updated': f"{datetime.now().strftime('%Y-%m-%d %H:%M')}",
# })
# if not updating_record:
# Notifier.notify(
# title=f'FAIL with clipboard_content: {clipboard_content}',
# message=f'🔴🔴🔴 NOTHING TO UPDATE',
# )
# else:
# Notifier.notify(
# title=f'UPDATED {linkedin_handle} in {table_name} table',
# message='🟢🟢🟢',
# )
# except Exception as e:
# Notifier.notify(
# title=f'FAIL with clipboard_content: {clipboard_content}',
# message=f'🔴🔴🔴 ERROR: {e}',
# )