Projects STRLCPY snscrape Commits bcad6923
🤬
  • ■ ■ ■ ■ ■ ■
    snscrape/modules/twitter.py
    skipped 54 lines
    55 55  class Tweet(snscrape.base.Item):
    56 56   url: str
    57 57   date: datetime.datetime
    58  - content: str
     58 + rawContent: str
    59 59   renderedContent: str
    60 60   id: int
    61 61   user: 'User'
    skipped 24 lines
    86 86   outlinksss = snscrape.base._DeprecatedProperty('outlinksss', lambda self: ' '.join(x.url for x in self.links) if self.links else '', 'links (url attribute)')
    87 87   tcooutlinks = snscrape.base._DeprecatedProperty('tcooutlinks', lambda self: [x.tcourl for x in self.links] if self.links else [], 'links (tcourl attribute)')
    88 88   tcooutlinksss = snscrape.base._DeprecatedProperty('tcooutlinksss', lambda self: ' '.join(x.tcourl for x in self.links) if self.links else '', 'links (tcourl attribute)')
     89 + content = snscrape.base._DeprecatedProperty('content', lambda self: self.rawContent, 'rawContent')
    89 90   
    90 91   def __str__(self):
    91 92   return self.url
    skipped 366 lines
    458 459   username: str
    459 460   id: int
    460 461   displayname: typing.Optional[str] = None
    461  - description: typing.Optional[str] = None # Description as it's displayed on the web interface with URLs replaced
    462 462   rawDescription: typing.Optional[str] = None # Raw description with the URL(s) intact
     463 + renderedDescription: typing.Optional[str] = None # Description as it's displayed on the web interface with URLs replaced
    463 464   descriptionLinks: typing.Optional[typing.List[TextLink]] = None
    464 465   verified: typing.Optional[bool] = None
    465 466   created: typing.Optional[datetime.datetime] = None
    skipped 13 lines
    479 480   descriptionUrls = snscrape.base._DeprecatedProperty('descriptionUrls', lambda self: self.descriptionLinks, 'descriptionLinks')
    480 481   linkUrl = snscrape.base._DeprecatedProperty('linkUrl', lambda self: self.link.url if self.link else None, 'link.url')
    481 482   linkTcourl = snscrape.base._DeprecatedProperty('linkTcourl', lambda self: self.link.tcourl if self.link else None, 'link.tcourl')
     483 + description = snscrape.base._DeprecatedProperty('description', lambda self: self.renderedDescription, 'renderedDescription')
    482 484   
    483 485   @property
    484 486   def url(self):
    skipped 341 lines
    826 828   tweetId = self._get_tweet_id(tweet)
    827 829   kwargs = {}
    828 830   kwargs['id'] = tweetId
    829  - kwargs['content'] = tweet['full_text']
     831 + kwargs['rawContent'] = tweet['full_text']
    830 832   kwargs['renderedContent'] = self._render_text_with_urls(tweet['full_text'], tweet['entities'].get('urls'))
    831 833   kwargs['user'] = user
    832 834   kwargs['date'] = email.utils.parsedate_to_datetime(tweet['created_at'])
    skipped 492 lines
    1325 1327   kwargs['username'] = user['screen_name']
    1326 1328   kwargs['id'] = id_ if id_ else user['id'] if 'id' in user else int(user['id_str'])
    1327 1329   kwargs['displayname'] = user['name']
    1328  - kwargs['description'] = self._render_text_with_urls(user['description'], user['entities']['description'].get('urls'))
    1329 1330   kwargs['rawDescription'] = user['description']
     1331 + kwargs['renderedDescription'] = self._render_text_with_urls(user['description'], user['entities']['description'].get('urls'))
    1330 1332   if user['entities']['description'].get('urls'):
    1331 1333   kwargs['descriptionLinks'] = [TextLink(
    1332 1334   text = x.get('display_url'),
    skipped 142 lines
    1475 1477   return None
    1476 1478   user = obj['data']['user']['result']
    1477 1479   rawDescription = user['legacy']['description']
    1478  - description = self._render_text_with_urls(rawDescription, user['legacy']['entities']['description']['urls'])
     1480 + renderedDescription = self._render_text_with_urls(rawDescription, user['legacy']['entities']['description']['urls'])
    1479 1481   link = None
    1480 1482   if user['legacy'].get('url'):
    1481 1483   entity = user['legacy']['entities'].get('url', {}).get('urls', [None])[0]
    skipped 9 lines
    1491 1493   username = user['legacy']['screen_name'],
    1492 1494   id = int(user['rest_id']),
    1493 1495   displayname = user['legacy']['name'],
    1494  - description = description,
    1495 1496   rawDescription = rawDescription,
     1497 + renderedDescription = renderedDescription,
    1496 1498   descriptionLinks = [TextLink(
    1497 1499   text = x.get('display_url'),
    1498 1500   url = x['expanded_url'],
    skipped 253 lines
Please wait...
Page is in error, reload to recover