Skip to content

Commit

Permalink
look for tweets.js too
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Nov 20, 2022
1 parent cb8f8b2 commit f6ef9ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

__version__ = "0.0.8"
__version__ = "0.0.9"

def long_description():
with open("README.md") as f:
Expand Down
9 changes: 7 additions & 2 deletions twitter_archive_unshorten.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,13 @@ def unshorten(urls, archive_dir):
else:
url_map = {}

# load short/long mapping already present in tweet.js
url_map.update(read_url_map(join(archive_dir, "data", "tweet.js")))
# load short/long mapping already present in tweet.js or tweets.js
tweet_js = join(archive_dir, "data", "tweet.js")
if not os.path.isfile(tweet_js):
tweet_js = join(archive_dir, "data", "tweets.js")

if os.path.isfile(tweet_js):
url_map.update(read_url_map(tweet_js))

count = 0
for short_url in urls:
Expand Down

0 comments on commit f6ef9ed

Please sign in to comment.