DocNow / diffengine

track changes to the news, where news is anything with an RSS feed
MIT License
177 stars 30 forks source link

update_with_media deprecated #87

Open scotnewsedits opened 4 years ago

scotnewsedits commented 4 years ago

Tweepy has deprecated update_with_media

As a suggestion at the following approx line 86 in twitter.py ;

    filenames = [diff.thumbnail_path, diff.screenshot_path]
            media_ids = []
            for filename in filenames:
                res = twitter.media_upload(filename)
                media_ids.append(res.media_id)
            status = twitter.update_status(status=text, media_ids=media_ids)
            logging.info( "Status after tweet %s" , status.id_str )
            #status = twitter.update_status(status='@' + self.auth.get_username() + ' ' + text, media_ids=media_ids,in_reply_to_status_id=thread_status_id_str,)

in twitter.py this uses the newer api and attaches both images to the tweet. The commented out code is as i had not fully tested the threading of tweets where you need to reference the user_name when replying.