FeedService
lobstr.services.feed.FeedService
Bases: BaseService
Service for interacting with the feed endpoints of the Lobstr API.
Methods:
| Name | Description |
|---|---|
`hot |
int = 1) -> Feed`: Retrieve the hottest posts from the feed. |
`new |
int = 1) -> Feed`: Retrieve the newest posts from the feed. |
`tag |
str, page: int = 1) -> Feed`: Retrieve posts associated with a specific tag. |
`filter |
str, page: int = 1) -> Feed`: Retrieve posts associated with multiple tags. |
Source code in lobstr/services/feed.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
filter(*tag, page=1)
async
Retrieve posts associated with multiple tags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*tag
|
str
|
The tags to filter posts by. |
()
|
page
|
int
|
The page number to retrieve. Defaults to 1. |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
Feed |
Feed
|
The feed object containing posts associated with the specified tags for the specified page. |
Raises:
| Type | Description |
|---|---|
FeedPageNotFound
|
If the specified page does not exist for the given tags in the feed. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/feed.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
hot(page=1)
async
Retrieve the hottest posts from the feed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int
|
The page number to retrieve. Defaults to 1. |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
Feed |
Feed
|
The feed object containing the hottest posts for the specified page. |
Raises:
| Type | Description |
|---|---|
FeedPageNotFound
|
If the specified page does not exist in the feed. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/feed.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
new(page=1)
async
Retrieve the newest posts from the feed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
int
|
The page number to retrieve. Defaults to 1. |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
Feed |
Feed
|
The feed object containing the newest posts for the specified page. |
Raises:
| Type | Description |
|---|---|
FeedPageNotFound
|
If the specified page does not exist in the feed. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/feed.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
tag(tag, page=1)
async
Retrieve posts associated with a specific tag.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
str
|
The tag to filter posts by. |
required |
page
|
int
|
The page number to retrieve. Defaults to 1. |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
Feed |
Feed
|
The feed object containing posts associated with the specified tag for the specified page. |
Raises:
| Type | Description |
|---|---|
FeedPageNotFound
|
If the specified page does not exist for the given tag in the feed. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/feed.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
StoryService
lobstr.services.story.StoryService
Bases: BaseService
Service for interacting with the story endpoints of the Lobstr API.
Methods:
| Name | Description |
|---|---|
`get |
str) -> Story`: Retrieve a story by its short ID. |
Source code in lobstr/services/story.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
get(short_id)
async
Retrieve a story by its short ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
short_id
|
str
|
The short ID of the story to retrieve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Story |
Story
|
An instance of the Story model representing the retrieved story. |
Raises:
| Type | Description |
|---|---|
StoryNotFound
|
If the story with the given short ID does not exist. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/story.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
CommentService
lobstr.services.comment.CommentService
Bases: BaseService
Service for interacting with the comments API.
Methods:
| Name | Description |
|---|---|
`get |
str) -> Comment`: Retrieve a comment by its short ID. |
Source code in lobstr/services/comment.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
get(short_id)
async
Retrieve a comment by its short ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
short_id
|
str
|
The short ID of the comment to retrieve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Comment |
Comment
|
The retrieved comment. |
Raises:
| Type | Description |
|---|---|
CommentNotFound
|
If the comment with the given short ID does not exist. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/comment.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
UserService
lobstr.services.user.UserService
Bases: BaseService
Service for interacting with the Lobstr API's user endpoints.
Methods:
| Name | Description |
|---|---|
`get |
str) -> User`: Fetches user information by username. |
Source code in lobstr/services/user.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
get(username)
async
Fetches user information by username.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username
|
str
|
The username of the user to fetch. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
User |
User
|
An instance of the User model containing user information. |
Raises:
| Type | Description |
|---|---|
UserNotFound
|
If the user with the specified username does not exist. |
HTTPError
|
If the request to the API fails for any other reason. |
Source code in lobstr/services/user.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
TagService
lobstr.services.tag.TagService
Bases: BaseService
Service for interacting with the tag endpoints of the Lobstr API.
Methods:
| Name | Description |
|---|---|
`get |
str) -> Tag`: Retrieve a tag by its name. |
`list |
Retrieve a list of all available tags. |
Source code in lobstr/services/tag.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
get(name)
async
Retrieve a tag by its name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the tag to retrieve. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Tag |
Tag
|
The tag object corresponding to the provided name. |
Raises:
| Type | Description |
|---|---|
TagNotFound
|
If the tag with the specified name does not exist. |
Source code in lobstr/services/tag.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
list()
async
Retrieve a list of all available tags.
Returns:
| Type | Description |
|---|---|
List[Tag]
|
List[Tag]: A list of tag objects. |
Source code in lobstr/services/tag.py
37 38 39 40 41 42 43 44 45 46 | |