def post_tweet(self):
        if not settings.TWITTER_CREDS:
            return

        if self.unreleased:
            raise RuntimeError('Unable to tweet about unreleased version')

        if self.tweet_id:
            return # because we already posted a tweet


        ch = self.changelog
        image_url = settings.BASE_URL + ch.get_absolute_url() \
                    + '?snap=1&version=' + self.number
        filename = sha1(image_url).hexdigest() + '.png'
        full_path = os.path.join(settings.SNAPSHOTS_ROOT, filename)


        result = envoy.run(
            '{root}/makescreenshot --width 590 --height 600 {url} {path}'.format(
                root=settings.PROJECT_ROOT,
                url=image_url,
                path=full_path))

        if result.status_code != 0:
            with log.fields(
                    status_code=result.status_code,
                    std_out=result.std_out,
                    std_err=result.std_err):
                log.error('Unable to make a screenshot')
                raise RuntimeError('Unable to make a screenshot')

        with open(full_path, 'rb') as f:
            from requests_oauthlib import OAuth1
            auth = OAuth1(*settings.TWITTER_CREDS)
            response = requests.post(
                'https://upload.twitter.com/1.1/media/upload.json',
                auth=auth,
                files={'media': ('screenshot.png',
                                 f.read(), 'image/png')})
            media_id = response.json()['media_id_string']

            url = settings.BASE_URL + self.get_absolute_url()
            text = '{number} of {namespace}/{name} was released: {url} #{namespace} #{name} #release'.format(
                number=self.number,
                namespace=ch.namespace,
                name=ch.name,
                url=url)
            response = requests.post(
                'https://api.twitter.com/1.1/statuses/update.json',
                auth=auth,
                data={'status': text,
                      'media_ids': media_id})
            if response.status_code == 200:
                self.tweet_id = response.json()['id_str']
                self.save(update_fields=('tweet_id',))
        return full_path