twitter: add permalink to Talon objects; extract shared method
This commit is contained in:
parent
19da373a0a
commit
e3f376d64f
4 changed files with 30 additions and 14 deletions
|
@ -25,15 +25,21 @@ def inputs() -> Sequence[Path]:
|
|||
return get_files(config.export_path)
|
||||
|
||||
|
||||
from .common import TweetId, permalink
|
||||
|
||||
|
||||
@dataclass(unsafe_hash=True)
|
||||
class Tweet:
|
||||
id_str: str
|
||||
id_str: TweetId
|
||||
created_at: datetime_aware
|
||||
screen_name: str
|
||||
text: str
|
||||
urls: Sequence[str]
|
||||
|
||||
@property
|
||||
def permalink(self) -> str:
|
||||
return permalink(screen_name=self.screen_name, id=self.id_str)
|
||||
|
||||
|
||||
# meh... just wrappers to tell apart tweets from favorites...
|
||||
@dataclass(unsafe_hash=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue