Feed
lobstr.models.feed.Feed
Bases: PageMixin
A Feed is an array of posts along with pagination info
Attributes:
| Name | Type | Description |
|---|---|---|
posts |
list[Post]
|
A list of Post objects in the feed |
page |
int
|
The current page number |
Source code in lobstr/models/feed.py
6 7 8 9 10 11 12 13 14 15 | |
Post
lobstr.models.post.Post
Bases: BaseModel
Represents a post on the lobste.rs home page.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The unique identifier for the post. |
description |
Content
|
The description of the post, including both HTML ( |
created_at |
datetime
|
The timestamp when the post was created. |
title |
str
|
The title of the post. |
score |
int
|
The score of the post, representing upvotes minus downvotes. |
flags |
int
|
The number of flags the post has received. |
tags |
list[str]
|
A list of tags associated with the post. |
comment_count |
int
|
The number of comments on the post. |
username |
str
|
The username of the poster. |
article_url |
str
|
The URL of the article linked to the post. |
url |
URLPair
|
A pair of URLs for the post, including canonical ( |
Source code in lobstr/models/post.py
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 | |
Story
lobstr.models.story.Story
Bases: Post
Represents a Story i.e. A Post & Its comments
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The unique identifier for the post. |
description |
Content
|
The description of the post, including both HTML ( |
created_at |
datetime
|
The timestamp when the post was created. |
title |
str
|
The title of the post. |
score |
int
|
The score of the post, representing upvotes minus downvotes. |
flags |
int
|
The number of flags the post has received. |
tags |
list[str]
|
A list of tags associated with the post. |
comment_count |
int
|
The number of comments on the post. |
username |
str
|
The username of the poster. |
article_url |
str
|
The URL of the article linked to the post. |
url |
URLPair
|
A pair of URLs for the post, including canonical ( |
comments |
List[Comment]
|
A list of comments associated with the story |
Source code in lobstr/models/story.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
Comment
lobstr.models.comment.Comment
Bases: BaseModel
Represents a comment on a post.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
The unique identifier for the comment. |
created_at |
datetime
|
The timestamp when the comment was created. |
edited_at |
Optional[datetime]
|
The timestamp when the comment was last edited, if applicable. |
is_deleted |
bool
|
Indicates whether the comment has been deleted. |
is_moderated |
bool
|
Indicates whether the comment has been moderated. |
score |
int
|
The score of the comment, representing upvotes minus downvotes. |
flags |
int
|
The number of flags the comment has received. |
depth |
int
|
The depth of the comment in the thread hierarchy. |
username |
str
|
The username of the commenter. |
content |
Content
|
The content of the comment, including both HTML ( |
parent |
Optional[str]
|
The ID of the parent comment, if this comment is a reply. |
url |
URLPair
|
URLs linking to the comment, |
Source code in lobstr/models/comment.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 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 | |
User
lobstr.models.user.User
Bases: BaseModel
represents a user.
Attributes:
| Name | Type | Description |
|---|---|---|
username |
str
|
The user's username. |
karma |
int
|
The user's karma score. |
about |
str
|
The user's about section. |
avatar_url |
str
|
The URL of the user's avatar image. |
created_at |
datetime
|
The date and time when the user was created. |
is_admin |
bool
|
Whether the user is an admin. |
is_moderator |
bool
|
Whether the user is a moderator. |
invited_by_user |
Optional[str]
|
The username of the user who invited this user, if applicable. |
Source code in lobstr/models/user.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 | |
Tag
lobstr.models.tag.Tag
Bases: BaseModel
Represents metadata related to a tag.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the tag. |
description |
str
|
A brief description of the tag. |
category |
str
|
The category of the tag. |
is_privileged |
bool
|
Indicates if the tag needs additional permissions to be used. |
is_media |
bool
|
Indicates if the tag is related to media content. |
is_active |
bool
|
Indicates if the tag is currently active. |
hotness_mod |
float
|
A modifier that affects the "hotness" score of stories (used for home page ranking) |
Source code in lobstr/models/tag.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
Content
lobstr.models.core.Content
Bases: str
A string subclass that holds both the original content and a plain version of it.
Attributes:
| Name | Type | Description |
|---|---|---|
cls/self |
str
|
The original HTML content. |
plain |
str
|
The plain version of the content. |
Source code in lobstr/models/core.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
URLPair
lobstr.models.core.URLPair
dataclass
dataclass that holds both canonical and short versions of a URL to a resource.
Attributes:
| Name | Type | Description |
|---|---|---|
canonical |
str
|
The canonical version of the URL. |
short |
str
|
The shortened version of the URL. |
Source code in lobstr/models/core.py
6 7 8 9 10 11 12 13 14 15 16 17 | |