Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
tomquirk committed Jan 11, 2025
1 parent b036847 commit dacec3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions linkedin_api/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ def get_profile_posts(
if data and "status" in data and data["status"] != 200:
self.logger.info("request failed: {}".format(data["message"]))
return [{}]
while data and "paginationToken" in data["metadata"] and data["metadata"]["paginationToken"] != "":
while (
data
and "paginationToken" in data["metadata"]
and data["metadata"]["paginationToken"] != ""
):
if len(data["elements"]) >= post_count:
break
pagination_token = data["metadata"]["paginationToken"]
Expand Down Expand Up @@ -178,7 +182,11 @@ def get_post_comments(self, post_urn: str, comment_count=100) -> List:
if data and "status" in data and data["status"] != 200:
self.logger.info("request failed: {}".format(data["status"]))
return [{}]
while data and "paginationToken" in data["metadata"] and data["metadata"]["paginationToken"] != "":
while (
data
and "paginationToken" in data["metadata"]
and data["metadata"]["paginationToken"] != ""
):
if len(data["elements"]) >= comment_count:
break
pagination_token = data["metadata"]["paginationToken"]
Expand Down Expand Up @@ -1139,7 +1147,9 @@ def get_current_profile_views(self):
"com.linkedin.voyager.identity.me.wvmpOverview.WvmpViewersCard"
]["insightCards"][0]["value"][
"com.linkedin.voyager.identity.me.wvmpOverview.WvmpSummaryInsightCard"
]["numViews"]
][
"numViews"
]

def get_school(self, public_id):
"""Fetch data about a given LinkedIn school.
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/test_linkedin_api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_follow_company(linkedin):
company["followingInfo"]["dashFollowingStateUrn"],
not company["followingInfo"]["following"],
)

assert not err


Expand Down

0 comments on commit dacec3c

Please sign in to comment.