This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from quintindunn/development
Merge development into main
- Loading branch information
Showing
20 changed files
with
446 additions
and
46 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,12 @@ | ||
import os | ||
|
||
from lapsepy.lapse import Lapse | ||
|
||
if __name__ == '__main__': | ||
lapse = Lapse(os.getenv("REFRESH_TOKEN")) | ||
|
||
username_to_block = input("Username to block: ") | ||
|
||
user = lapse.get_profile_by_username(username_to_block) | ||
|
||
lapse.block_profile(user) |
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,12 @@ | ||
import os | ||
|
||
from lapsepy.lapse import Lapse | ||
|
||
if __name__ == '__main__': | ||
lapse = Lapse(os.getenv("REFRESH_TOKEN")) | ||
|
||
username_to_block = input("Username to block: ") | ||
|
||
user = lapse.get_profile_by_username(username_to_block) | ||
|
||
user.block(lapse) |
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,18 @@ | ||
import os | ||
|
||
from lapsepy.lapse import Lapse | ||
|
||
if __name__ == '__main__': | ||
lapse = Lapse(os.getenv("REFRESH_TOKEN")) | ||
|
||
darkroom_media = lapse.query_darkroom() | ||
|
||
if not os.path.isdir("./out"): | ||
os.mkdir("./out") | ||
|
||
for content in darkroom_media: | ||
# Load the image | ||
im = content.load() | ||
|
||
# Save the image | ||
im.save(f"./out/{content.media_id}.jpeg", format="jpeg") |
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,12 @@ | ||
import os | ||
from lapsepy.lapse import Lapse | ||
|
||
if __name__ == '__main__': | ||
lapse = Lapse(refresh_token=os.getenv("REFRESH_TOKEN")) | ||
|
||
album_id = input("Album ID: ") | ||
|
||
album = lapse.get_album_by_id(album_id, last=10) | ||
|
||
for media in album.media: | ||
im = media.load() |
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,12 @@ | ||
import os | ||
|
||
from lapsepy.lapse import Lapse | ||
|
||
if __name__ == '__main__': | ||
lapse = Lapse(os.getenv("REFRESH_TOKEN")) | ||
|
||
username_to_block = input("Username to unblock: ") | ||
|
||
user = lapse.get_profile_by_username(username_to_block) | ||
|
||
lapse.unblock_profile(user) |
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,12 @@ | ||
import os | ||
|
||
from lapsepy.lapse import Lapse | ||
|
||
if __name__ == '__main__': | ||
lapse = Lapse(os.getenv("REFRESH_TOKEN")) | ||
|
||
username_to_block = input("Username to unblock: ") | ||
|
||
user = lapse.get_profile_by_username(username_to_block) | ||
|
||
user.unblock(ctx=lapse) |
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
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,33 @@ | ||
""" | ||
Author: Quintin Dunn | ||
Date: 11/23/23 | ||
""" | ||
from lapsepy.journal.factory.factory import BaseGQL | ||
|
||
|
||
class AlbumMediaGQL(BaseGQL): | ||
def __init__(self, album_id: str, last: int): | ||
super().__init__("AlbumMediaGraphQLQuery", | ||
"query AlbumMediaGraphQLQuery($id: ID!, $first: Int, $after: String, $last: Int, $before: " | ||
"String) { album(id: $id) { __typename id media(first: $first, after: $after, last: $last, " | ||
"before: $before) { __typename totalCount edges { __typename cursor node { __typename " | ||
"...AlbumMediaDetails } } pageInfo { __typename startCursor endCursor hasNextPage " | ||
"hasPreviousPage } } } }\nfragment AlbumMediaDetails on AlbumMedia { __typename addedAt { " | ||
"__typename isoString } media { __typename ...CoreMediaFragment } }\nfragment " | ||
"CoreMediaFragment on Media { __typename id takenAt { __typename isoString } takenBy { " | ||
"__typename ...CoreProfileFragment } deletedAt { __typename isoString } }\nfragment " | ||
"CoreProfileFragment on Profile { __typename id displayName profilePhotoName username " | ||
"friendStatus isBlocked blockedMe hashedPhoneNumber joinedAt { __typename isoString } }") | ||
|
||
self.album_id = album_id | ||
self.last = last | ||
|
||
self.variables = {} | ||
|
||
self._render_variables() | ||
|
||
def _render_variables(self): | ||
self.variables = { | ||
"id": self.album_id, | ||
"last": self.last | ||
} |
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
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
Oops, something went wrong.