|
54 | 54 |
|
55 | 55 | # retrieve company id from the api
|
56 | 56 | postdata1 = {"operationName":"EntitySubpage","variables":{"id":company,"moduleType":"employees"},"query":"query EntitySubpage($id: SlugOrID!, ) {\n entityPageEX(id: $id) {\n ... on EntityPage {\n slug\n title\n context {\n companyId\n }\n }\n }\n}\n"}
|
57 |
| - r = requests.post(api, data=json.dumps(postdata1), headers=headers, cookies=cookies_dict) |
| 57 | + r = requests.post(api, data=json.dumps(postdata1), headers=headers, cookies=cookies_dict, timeout=10) |
58 | 58 | response1 = r.json()
|
59 | 59 |
|
60 | 60 | companyID = response1["data"]["entityPageEX"]["context"]["companyId"]
|
61 | 61 |
|
62 | 62 | # retrieve employee information from the api based on previously obtained company id
|
63 | 63 | postdata2 = {"operationName":"Employees","variables":{"consumer":"","id":companyID,"first":count,"query":{"consumer":"web.entity_pages.employees_subpage","sort":"CONNECTION_DEGREE"}},"query":"query Employees($id: SlugOrID!, $first: Int, $after: String, $query: CompanyEmployeesQueryInput!, $consumer: String! = \"\", $includeTotalQuery: Boolean = false) {\n company(id: $id) {\n id\n totalEmployees: employees(first: 0, query: {consumer: $consumer}) @include(if: $includeTotalQuery) {\n total\n }\n employees(first: $first, after: $after, query: $query) {\n total\n edges {\n node {\n profileDetails {\n id\n firstName\n lastName\n displayName\n gender\n pageName\n location {\n displayLocation\n }\n occupations {\n subline\n }\n }\n }\n }\n }\n }\n}\n"}
|
64 |
| - r2 = requests.post(api, data=json.dumps(postdata2), headers=headers, cookies=cookies_dict) |
| 64 | + r2 = requests.post(api, data=json.dumps(postdata2), headers=headers, cookies=cookies_dict, timeout=10) |
65 | 65 | response2 = r2.json()
|
66 | 66 |
|
67 | 67 | if not args.quiet:
|
|
118 | 118 | if args.full:
|
119 | 119 | # dump additional contact details for each employee. Most often is "None", so no default api queries for this data
|
120 | 120 | postdata3 = {"operationName":"getXingId","variables":{"profileId":pagename},"query":"query getXingId($profileId: SlugOrID!, $actionsFilter: [AvailableAction!]) {\n profileModules(id: $profileId) {\n __typename\n xingIdModule(actionsFilter: $actionsFilter) {\n xingId {\n status {\n localizationValue\n __typename\n }\n __typename\n }\n __typename\n ...xingIdContactDetails\n }\n }\n}\n\nfragment xingIdContactDetails on XingIdModule {\n contactDetails {\n business {\n email\n fax {\n phoneNumber\n }\n mobile {\n phoneNumber\n }\n phone {\n phoneNumber\n }\n }\n __typename\n }\n __typename\n}\n"}
|
121 |
| - r3 = requests.post(api, data=json.dumps(postdata3), headers=headers, cookies=cookies_dict) |
| 121 | + r3 = requests.post(api, data=json.dumps(postdata3), headers=headers, cookies=cookies_dict, timeout=10) |
122 | 122 | response3 = r3.json()
|
123 | 123 | try:
|
124 | 124 | # try to extract contact details
|
|
0 commit comments