add ability to announce tweets by ID as cmd arg

- also fix a TalentTweet constructor filter
This commit is contained in:
muskit
2023-08-18 21:44:30 -07:00
parent a5119ae298
commit ffe990d899
4 changed files with 53 additions and 6 deletions
+18
View File
@@ -147,3 +147,21 @@ class TwAPI:
else:
raise e
return True
async def post_ttweet_by_id(self, id: int):
from scraper import Scraper
print(f'Manually posting tweet {id}')
s = Scraper()
t = s.get_tweet(id, True)
if not t:
print('Tweet could not be retrieved')
return False
ttweet = tt.TalentTweet.create_from_tweety(t)
if not ttweet.is_cross_company():
print(f'{ttweet.username}/{ttweet.tweet_id} is not cross-company!')
return False
print(f'Posting {ttweet.username}/{ttweet.tweet_id}...')
return await self.post_ttweet(ttweet)