-
Notifications
You must be signed in to change notification settings - Fork 9
Migrate to 3.0.0
Here are a migration guide from 2.1.7 to 3.0.0 version of twitter-archive-reader
.
This new object now holds and manage tweets available inside the Twitter archive.
It is accessible with the .tweets
property of a TwitterArchive
instance.
Available methods/properties are the same as the old tweet access way of a TwitterArchive
instance.
-
[Symbol.iterator]()
: This object is iterable. It iterates over tweets. -
.monthIterator()
: A generator that allow iteration tweet per tweet sorted byyear
andmonth
-
.single(id: string)
: Replaces oldTwitterArchive.id()
.
-
.with(user_id: string | string[])
: Get conversations that include all the specified user ids.
-
.index
: Tweet index is moved to.tweets.index
and archive information/user to.info
. It will be removed in a future release.
Tweet access properties and methods still exists on the TwitterArchive
object, but are marked as deprecated. Please use the ones available on TweetArchive
.
-
.loadArchivePart()
became asynchronous. Don't forget to addawait
before calls to this method. -
.raw
now returns three archives: Loaded archive file, DM image ZIP (if loaded) and group DM image ZIP (if loaded). -
.requiresDmImageZipLoad()
is now a property,.requires_dm_image_load
. -
.archive_save_info
is now named.synthetic_info
-
.hash()
is now a property,.hash
.
All the tweet access methods and property from TwitterArchive
instances are moved to TweetArchive
instance.
It is accessible with the .tweets
property.
Moved attributes are:
.all
.length
.month()
.between()
.fromThatDay()
-
.isGDPRTweet()
(+ became static)
All of these are available in the TweetArchive
instance.
dateFromTweet()
, parseTwitterDate()
, isWithMedia()
and isWithVideo()
are now static methods of TweetArchive
. Access them with TweetArchive.<methodName>()
.
-
.importDmImageZip()
,.importDmGroupImageZip()
and.loadCurrentDmImageZip()
are now private. Please use the new parameters of.loadArchivePart()
:dm_image_file
,dm_image_group_file
andcurrent_dm_images
.
- Direct Messages