diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index 75e3501..92992d1 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -57,7 +57,10 @@ class PublicRelations(Bureau): """ with self.dbenv.begin(db=self.tweetdb) as txn: tweetid = txn.get(tweet_hash.encode()) - return int(tweetid) + if tweetid: + return int(tweetid) + else: + return tweetid def short_tweet_id(self, tweet_id): """ @@ -151,8 +154,8 @@ class PublicRelations(Bureau): """ Print detailed tweet info and commands for reply, like, retweet, etc. """ - self.log.debug("got data " + str(data)) - tweet_id = self.get_tweet_id(data) + shortcode, _ = data.split(".") + tweet_id = self.get_tweet_id(shortcode) self.log.debug("tweet details for id:" + tweet_id) tweet = self.t.t.statuses.show(id=tweet_id) prn = printer.Usb(0x416, 0x5011, in_ep=0x81, out_ep=0x03)