chronicle-imessage 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -10
- data/chronicle-imessage.gemspec +1 -1
- data/lib/chronicle/imessage/imessage_extractor.rb +7 -7
- data/lib/chronicle/imessage/imessage_transformer.rb +3 -3
- data/lib/chronicle/imessage/local_contacts.rb +2 -0
- data/lib/chronicle/imessage/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c6cdfbc6a52ca7ae467378ff36cb35ad24c8a4dcbeee36a3953daab19a8e6e2
|
4
|
+
data.tar.gz: 28768a3f6378e7e5c2327cdec73dcdff9bab064f32e9f7c93784e49fac3f249d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7f1101ccbf489834f48a5bc909758bb6d1d4b0c34a512a4b17b31efcf9d851a0c1d7174e8745b35671df9cd2e9d4b525216e4d2a9800dbb63c16d1047f0432a
|
7
|
+
data.tar.gz: 2e8601ef4107929d5ce524e62badaa5b7f16afebb4b7527455ffcf0542b12c4bdc0aee5147bf053f2e505e04593e52f6674127718a174064069bde897564af89
|
data/README.md
CHANGED
@@ -1,18 +1,42 @@
|
|
1
1
|
# Chronicle::Imessage
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/chronicle-imessage.svg)](https://badge.fury.io/rb/chronicle-imessage)
|
2
3
|
|
3
|
-
|
4
|
+
Access your iMessage messages and attachments using the command line with this plugin for [chronicle-etl](https://github.com/chronicle-app/chronicle-etl).
|
5
|
+
|
6
|
+
## Usage
|
7
|
+
|
8
|
+
```sh
|
9
|
+
# Install chronicle-etl and this plugin
|
10
|
+
$ gem install chronicle-etl
|
11
|
+
$ chronicle-etl plugins:install imessage
|
12
|
+
|
13
|
+
# Load messages since February 7
|
14
|
+
$ chronicle-etl --extractor imessage --transformer imessage --since "2022-02-07"
|
15
|
+
|
16
|
+
# Of the latest 1000 messages received, who were the top senders?
|
17
|
+
$ chronicle-etl -e imessage -t imessage --limit 1000 --no-header-row --fields actor.title | sort | uniq -c | sort -nr
|
18
|
+
|
19
|
+
# Get the raw query results for the latest 10 messages and save as a CSV
|
20
|
+
$ chronicle-etl -e imessage --loader csv --limit 10 -o imessages.csv
|
21
|
+
```
|
4
22
|
|
5
23
|
## Available Connectors
|
6
24
|
### Extractors
|
7
|
-
- `imessage` - Extractor for importing messages and attachments from local macOS iMessage install (`~/Library/Messages/chat.db`)
|
8
25
|
|
9
|
-
|
10
|
-
|
26
|
+
#### `imessage`
|
27
|
+
Extractor for importing messages and attachments from local macOS iMessage install (`~/Library/Messages/chat.db`)
|
11
28
|
|
12
|
-
|
29
|
+
##### Settings
|
30
|
+
- `load_attachments`: (default: false) Whether to load message attachments
|
31
|
+
- `only_attachments`: (default: fasle) Whether to load only messages with attachments
|
13
32
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
33
|
+
We want messages to have sender/receiver information set properly so we try to infer your iCloud information and phone number automatically. If these fail, you can provide the necessary information with:
|
34
|
+
- `my_phone_number`: Your phone number (for setting messages's actor fields properly)
|
35
|
+
- `my_name`: Your name (for setting messages's actor fields properly)
|
36
|
+
- `icloud_account_id`: Specify an email address that represents your iCloud account ID
|
37
|
+
- `icloud_account_dsid`: Specify iCloud DSID
|
38
|
+
- Can find in Keychain or by running `$ defaults read MobileMeAccounts Accounts`
|
39
|
+
### Transformers
|
40
|
+
|
41
|
+
#### `imessage`
|
42
|
+
Transform an iMessage message into Chronicle Schema
|
data/chronicle-imessage.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
36
|
spec.require_paths = ["lib"]
|
37
37
|
|
38
|
-
spec.add_dependency "chronicle-etl", "~> 0.4.
|
38
|
+
spec.add_dependency "chronicle-etl", "~> 0.4.4"
|
39
39
|
spec.add_dependency "sqlite3", "~> 1.4"
|
40
40
|
spec.add_dependency "phonelib", "~> 0.6"
|
41
41
|
|
@@ -27,8 +27,8 @@ module Chronicle
|
|
27
27
|
meta = {}
|
28
28
|
meta[:participants] = @chats[message['chat_id']]
|
29
29
|
meta[:attachments] = @attachments[message['message_id']] if @attachments
|
30
|
-
meta[:my_phone_contact] = @my_phone_contact
|
31
|
-
meta[:my_icloud_account] = @my_icloud_account
|
30
|
+
meta[:my_phone_contact] = @my_phone_contact if @my_phone_contact.values.all?
|
31
|
+
meta[:my_icloud_account] = @my_icloud_account if @my_icloud_account.values.all?
|
32
32
|
|
33
33
|
yield Chronicle::ETL::Extraction.new(data: message, meta: meta)
|
34
34
|
end
|
@@ -58,16 +58,16 @@ module Chronicle
|
|
58
58
|
|
59
59
|
def load_my_phone_contact(local_contacts)
|
60
60
|
{
|
61
|
-
phone_number: @config.my_phone_number || local_contacts.my_phone_contact
|
62
|
-
name: @config.my_name || local_contacts.my_phone_contact
|
61
|
+
phone_number: @config.my_phone_number || local_contacts.my_phone_contact&.fetch(:phone_number),
|
62
|
+
name: @config.my_name || local_contacts.my_phone_contact&.fetch(:full_name)
|
63
63
|
}
|
64
64
|
end
|
65
65
|
|
66
66
|
def load_my_icloud_account(local_contacts)
|
67
67
|
{
|
68
|
-
id:
|
69
|
-
dsid: @config.icloud_account_dsid || local_contacts.my_icloud_account
|
70
|
-
display_name: @config.icloud_account_display_name || @config.my_name || local_contacts.my_icloud_account
|
68
|
+
id: nil,
|
69
|
+
dsid: @config.icloud_account_dsid || local_contacts.my_icloud_account&.fetch(:AccountDSID),
|
70
|
+
display_name: @config.icloud_account_display_name || @config.my_name || local_contacts.my_icloud_account&.fetch(:DisplayName)
|
71
71
|
}
|
72
72
|
end
|
73
73
|
|
@@ -102,7 +102,7 @@ module Chronicle
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def build_identity identity
|
105
|
-
raise
|
105
|
+
raise(Chronicle::ETL::UntransformableRecordError, "Could not build record due to missing identity data") unless identity
|
106
106
|
|
107
107
|
record = ::Chronicle::ETL::Models::Entity.new({
|
108
108
|
represents: 'identity',
|
@@ -125,7 +125,7 @@ module Chronicle
|
|
125
125
|
|
126
126
|
def build_identity_mine_icloud
|
127
127
|
icloud_account = @extraction.meta[:my_icloud_account]
|
128
|
-
raise(UntransformableRecordError, "
|
128
|
+
raise(Chronicle::ETL::UntransformableRecordError, "Could not build record due to missing iCloud details. Please provide them through the extractor settings.") unless icloud_account
|
129
129
|
|
130
130
|
record = ::Chronicle::ETL::Models::Entity.new({
|
131
131
|
represent: 'identity',
|
@@ -140,7 +140,7 @@ module Chronicle
|
|
140
140
|
|
141
141
|
def build_identity_mine_phone
|
142
142
|
phone_account = @extraction.meta[:my_phone_contact]
|
143
|
-
raise(UntransformableRecordError, "
|
143
|
+
raise(Chronicle::ETL::UntransformableRecordError, "Could not build record due to missing phone details. Please provide them through the extractor settings.") unless phone_account
|
144
144
|
|
145
145
|
record = ::Chronicle::ETL::Models::Entity.new({
|
146
146
|
represent: 'identity',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chronicle-imessage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Louis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chronicle-etl
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sqlite3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|