Skip to content

Commit

Permalink
If tweets starts with @, prepend a .
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M Furley committed Jun 13, 2018
1 parent 7f4ddef commit 2be32bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scraper.py
Expand Up @@ -95,6 +95,9 @@ def tweet(self):

self._description = self.replace(self._description)

if self._description.startswith('@'):
self._description = '.{}'.format(self._description)

if len(self._description) <= character_budget:
short_desc = self._description
else:
Expand All @@ -117,8 +120,6 @@ def replace(description):
"the ICO",
]

# TODO: prepend a . where the tweet starts with @ICOnews

for name in ico_names:
new = description.replace(name, '@ICOnews')
if new != description:
Expand Down

0 comments on commit 2be32bc

Please sign in to comment.