-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1795086
commit e39b599
Showing
2 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...shared/external_services/user_reward_mission/missions/clutch_rating_and_review_mission.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import requests | ||
from typing import Dict | ||
from bs4 import BeautifulSoup | ||
|
||
from locker_server.shared.constants.missions import REWARD_TYPE_PROMO_CODE | ||
from locker_server.shared.external_services.user_reward_mission.mission import Mission | ||
|
||
|
||
class ClutchRatingAndReviewMission(Mission): | ||
def __init__(self, mission_type: str, extra_requirements=None): | ||
super().__init__(mission_type=mission_type, extra_requirements=extra_requirements) | ||
self.reward_type = REWARD_TYPE_PROMO_CODE | ||
self.reward_value = 5 | ||
|
||
def check_mission_completion(self, input_data: Dict): | ||
return False | ||
url = f"https://clutch.co/profile/locker-password-manager?sort_by=date_desc#reviews" | ||
headers = { | ||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) " | ||
"Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.58", | ||
} | ||
res = requests.get(url=url, headers=headers) | ||
if res.status_code != 200: | ||
return False | ||
content = res.text | ||
soup = BeautifulSoup(content, features="html.parser") | ||
|