-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Showing
8 changed files
with
149 additions
and
5 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
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,30 @@ | ||
from ensta.structures.AddedComment import AddedComment | ||
from ensta.structures.AddedCommentUser import AddedCommentUser | ||
from .AddedCommentUserParser import parse_added_comment_user | ||
|
||
|
||
def parse_added_comment(information: dict) -> AddedComment: | ||
|
||
comment_dict: dict = information.get("comment") | ||
user: AddedCommentUser = parse_added_comment_user(comment_dict.get("user")) | ||
|
||
return AddedComment( | ||
comment_id=comment_dict.get("pk"), | ||
user_id=str(comment_dict.get("user_id")), | ||
type=comment_dict.get("type"), | ||
did_report_as_spam=comment_dict.get("did_report_as_spam"), | ||
created_at=comment_dict.get("created_at"), | ||
created_at_utc=comment_dict.get("created_at_utc"), | ||
content_type=comment_dict.get("content_type"), | ||
status=comment_dict.get("status"), | ||
bit_flags=comment_dict.get("bit_flags"), | ||
share_enabled=comment_dict.get("share_enabled"), | ||
is_ranked_comment=comment_dict.get("is_ranked_comment"), | ||
media_id=str(comment_dict.get("media_id")), | ||
restricted_status=comment_dict.get("restricted_status"), | ||
is_created_by_media_owner=comment_dict.get("is_created_by_media_owner"), | ||
user=user, | ||
text=comment_dict.get("text"), | ||
is_covered=comment_dict.get("is_covered"), | ||
comment_creation_key=information.get("comment_creation_key") | ||
) |
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,19 @@ | ||
from ensta.structures.AddedCommentUser import AddedCommentUser | ||
|
||
|
||
def parse_added_comment_user(information: dict) -> AddedCommentUser: | ||
|
||
return AddedCommentUser( | ||
user_id=str(information.get("pk")), | ||
username=information.get("username"), | ||
full_name=information.get("full_name"), | ||
is_private=information.get("is_private"), | ||
has_onboarded_to_text_post_app=information.get("has_onboarded_to_text_post_app"), | ||
fbid_v2=str(information.get("fbid_v2")), | ||
is_verified=information.get("is_verified"), | ||
profile_picture_id=information.get("profile_pic_id"), | ||
profile_picture_url=information.get("profile_pic_url"), | ||
is_mentionable=information.get("is_mentionable"), | ||
latest_reel_media=information.get("latest_reel_media"), | ||
latest_besties_reel_media=information.get("latest_besties_reel_media") | ||
) |
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
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,29 @@ | ||
from dataclasses import dataclass | ||
from .AddedCommentUser import AddedCommentUser | ||
|
||
|
||
@dataclass | ||
class AddedComment: | ||
|
||
""" | ||
Stores information about the comment you posted e.g. - Comment ID, Text, Comment Type etc. | ||
""" | ||
|
||
comment_id: str | ||
user_id: str | ||
type: int | ||
did_report_as_spam: bool | ||
created_at: int | ||
created_at_utc: int | ||
content_type: str | ||
status: str | ||
bit_flags: int | ||
share_enabled: bool | ||
is_ranked_comment: bool | ||
media_id: str | ||
restricted_status: int | ||
is_created_by_media_owner: bool | ||
user: AddedCommentUser | ||
text: str | ||
is_covered: bool | ||
comment_creation_key: str |
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,22 @@ | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class AddedCommentUser: | ||
|
||
""" | ||
Stores information of user who added the comment (you) e.g. - User ID, Username, Full Name, etc. | ||
""" | ||
|
||
user_id: str | ||
username: str | ||
full_name: str | ||
is_private: bool | ||
has_onboarded_to_text_post_app: bool | ||
fbid_v2: str | ||
is_verified: bool | ||
profile_picture_id: str | ||
profile_picture_url: str | ||
is_mentionable: bool | ||
latest_reel_media: int | ||
latest_besties_reel_media: int |
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
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