Skip to content

Commit

Permalink
add pinned to post
Browse files Browse the repository at this point in the history
also make responsetype more accurate in database
  • Loading branch information
datawhores committed Apr 2, 2024
1 parent 7f6454b commit 67ca063
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ofscraper/classes/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def responsetype(self):
return "pinned"
elif self.archived:
return "self.archived"
elif self.post.get("responseType")=="post":
return "timeline"
return self.post.get("responseType")


@property
Expand Down
2 changes: 1 addition & 1 deletion ofscraper/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def process_download_cart():
url = constants.getattr("messageTableSPECIFIC").format(
row[username].plain, row[post_id].plain
)
elif row[restype].plain == "post":
elif row[restype].plain in {"pinned","timeline","archived"}:
url = f"{row[post_id]}"
elif row[restype].plain == "highlights":
url = constants.getattr("storyEP").format(row[post_id].plain)
Expand Down
2 changes: 1 addition & 1 deletion ofscraper/db/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def add_column_tables(model_id=None, username=None):
await add_column_media_posted_at(model_id=model_id, username=username)
await add_flag_schema("media_posted_at", model_id=model_id, username=username)
if not "posts_pinned" in changes:
await add_column_posts_pinned(model_id=model_id, username=username)
await add_column_post_pinned(model_id=model_id, username=username)
await add_flag_schema("posts_pinned", model_id=model_id, username=username)
if not "posts_model_id" in changes:
await add_column_post_ID(model_id=model_id, username=username)
Expand Down

0 comments on commit 67ca063

Please sign in to comment.