Skip to content

Commit 70a89d3

Browse files
Merge pull request #184 from zeus-fyi/mb-sales
adds linkedIn guide
2 parents 6ab1dbc + 75427ee commit 70a89d3

File tree

12 files changed

+243
-168
lines changed

12 files changed

+243
-168
lines changed

.github/workflows/zeusfyi_docs.yml

-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ jobs:
4040
--token ${{ secrets.DEPOT_TOKEN }} \
4141
--provenance=false \
4242
-f docker/docusaurus/Dockerfile . --push
43-

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ Thumbs.db
7070
/examples/mockingbird/python/mock/
7171
/examples/mockingbird/mockingbooks_py/mock/
7272
/examples/mockingbird/mockingbooks_py/google_search_regex/tmp/
73+
/examples/mockingbird/mockingbooks_py/lead_scoring_automation/tmp/

README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ Workflow & Proxy Programmable Automation (Rolling releases coming through end of
150150
#### ```artemis_workflows ```
151151
#### ```iris_programmable_proxy ```
152152

153-
QuickNode MarketPlace users can find Load Balancing documentation in the iris programmable proxy directory
154-
+ Adaptive Load Balancer Documentation
155-
156153
#### API Endpoints
157154

158155
Documentation and code examples are found here
@@ -274,7 +271,7 @@ Recommended reading for scientists, engineers, data driven individuals
274271

275272
https://medium.com/zeusfyi/show-me-the-stats-6740f8d6d0b7
276273

277-
## Adaptive RPC Load Balancer on QuickNode Marketplace
274+
## Adaptive RPC Load Balancer
278275
Accurate, Reliable, Performant Node Traffic at Web3 Scale
279276

280277
![Screenshot 2023-09-14 at 11 11 30 PM](https://github.com/zeus-fyi/zeus/assets/17446735/802b7670-6b30-4e65-9348-e45e2a0cfcac)
@@ -283,5 +280,3 @@ https://medium.com/zeusfyi/adaptive-rpc-load-balancer-on-quicknode-marketplace-e
283280

284281
![Screenshot 2023-09-14 at 11 13 55 PM](https://github.com/zeus-fyi/zeus/assets/17446735/1d2a263e-5aa7-418c-a0f0-1f497cab0353)
285282

286-
Beta Testing Sign Up (free to use):
287-
https://marketplace.quicknode.com/add-on/zeusfyi-4

apps/docusaurus/zeusfyi/docs/lb/plans/discover.md

-27
This file was deleted.

apps/docusaurus/zeusfyi/docs/lb/plans/lite.md

-27
This file was deleted.

apps/docusaurus/zeusfyi/docs/lb/plans/performance.md

-28
This file was deleted.

apps/docusaurus/zeusfyi/docs/lb/plans/standard.md

-28
This file was deleted.

examples/mockingbird/mockingbooks_py/api_setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
'Authorization': f'Bearer {bearer_token}'
1010
}
1111

12-
# api_v1_path = "https://api.zeus.fyi/v1"
12+
api_v1_path = "https://api.zeus.fyi/v1"
1313

1414

15-
api_v1_path = "http://localhost:9001/v1"
15+
# api_v1_path = "http://localhost:9001/v1"
1616

1717

1818
def get_headers():

examples/mockingbird/mockingbooks_py/google_search_regex/google_api_searches.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def create_google_regex_search_index_entities_wf(task_str_id, eval_str_id, agg_t
77
with open('mocks/workflow.json', 'r') as file:
88
jdata = json.load(file)
99

10-
jdata['stepSize'] = 5
10+
jdata['stepSize'] = 15
1111
jdata['stepSizeUnit'] = 'minutes'
1212

1313
# Add a task to the workflow

examples/mockingbird/mockingbooks_py/google_search_regex/html_regex_example.py

+55-32
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import json
22
import re
3+
import time
34

45
from examples.mockingbird.mockingbooks_py.entities import EntitiesFilter, search_entities
5-
6-
# Path to the file
7-
file_path = 'tmp/tmp.txt'
8-
9-
# Open the file and read its contents
10-
with open(file_path, 'r') as file:
11-
text = file.read()
12-
13-
# Define two patterns
14-
pattern1 = r'data-anonymize="person-name">\s*([^<]+?)\s*</a>'
15-
pattern2 = r'<span data-anonymize="company-name">\s*([^<]+?)\s*</span>'
6+
from examples.mockingbird.mockingbooks_py.google_search_regex.dynamic_google_search import start_wf
167

178
agg_prompt = ("Can you summarize the relevant person and/or associated business entity from the search results? It "
189
"should use the most relevant search result that matches best and ignore others to prevent mixing"
@@ -23,35 +14,67 @@
2314
"with the metadata sources that are associated from that platform, business, ie. LinkedIn, Twitter, etc."
2415
"so that we associate the correct entity metadata with the correct platforms.")
2516

26-
# Find all matches for both patterns
27-
matches1 = re.findall(pattern1, text)
28-
matches2 = re.findall(pattern2, text)
2917

30-
# Check if lengths are equal
31-
if len(matches1) > len(matches2):
32-
matches1, matches2 = matches2, matches1
18+
# Function to process each <li> element
19+
def process_li_element(li_text):
20+
# Define the patterns for extracting person's name and company
21+
name_pattern = r'data-anonymize="person-name">\s*([^<]+?)\s*</span>'
22+
# Updated company pattern to stop at the first '<' character, ensuring no '>' is included
23+
company_pattern = r'data-anonymize="company-name"[^>]*>\s*([^<]+?)\s*<'
24+
25+
# Search for name and company within the <li> element text
26+
name_match = re.search(name_pattern, li_text)
27+
company_match = re.search(company_pattern, li_text)
28+
29+
# If both name and company are found, return them
30+
if name_match and company_match:
31+
return name_match.group(1), company_match.group(1)
32+
else:
33+
return None
34+
35+
36+
def iterate_on_matches():
37+
# List to store all matches
38+
all_matches = []
39+
count = 0
40+
41+
# Process files from page1 to page60
42+
for page_num in range(1, 61):
43+
44+
file_path = f'tmp/page{page_num}.txt'
45+
46+
# Open the file and read its contents
47+
with open(file_path, 'r') as file:
48+
text = file.read()
49+
# Assuming 'text' contains the HTML content from your file
50+
# Define the regex pattern to capture each <li> element
51+
li_pattern = r'<li class="artdeco-list__item[^>]*>.*?</li>'
52+
53+
# Find all <li> elements
54+
li_elements = re.findall(li_pattern, text, re.DOTALL)
3355

34-
offset_l = 80
35-
offset_r = 100
56+
# Process each <li> element to extract names and companies
57+
matches = [process_li_element(li) for li in li_elements]
3658

37-
# skip next
38-
# for i in range(len(matches1)):
39-
# person_company = f"{i}:{matches1[i]} (company)"
40-
# if 0 + offset_l < i < 1 + offset_r:
41-
# print(person_company)
42-
# start_wf(person_company, agg_prompt)
59+
# Filter out any None results
60+
matches = [match for match in matches if match is not None]
4361

62+
# Iterate and print each match
63+
for name, company in matches:
64+
count += 1
4465

45-
# Example iteration and action simulation with 'start_wf' function.
46-
# Since the 'start_wf' function is a conceptual example, we'll simulate its operation as a print statement.
47-
# for person_company in formatted_people_companies:
48-
# # Simulate calling 'start_wf' function with the person_company tuple and aggregated prompt.
49-
# start_wf(person_company, agg_prompt)
50-
#
66+
if count > 722:
67+
nc = f'Name: {name}, Company: {company}'
68+
print(nc)
69+
start_wf(nc, agg_prompt)
70+
all_matches += [(name, company)]
71+
count += 1
72+
time.sleep(10)
73+
print(count)
5174

52-
# skip next
5375

5476
if __name__ == '__main__':
77+
iterate_on_matches()
5578
search_entities_f = EntitiesFilter()
5679

5780
pretty_data1 = search_entities(search_entities_f)

0 commit comments

Comments
 (0)