Coder Social home page Coder Social logo

chronicle-app / chronicle-imessage Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 54 KB

chronicle-etl plugin for accessing your iMessage messages and attachments using the command line

Ruby 99.26% Shell 0.74%
imessage personal-data chronicle-etl chronicle-plugin data-liberation digital-history icloud

chronicle-imessage's Introduction

Chronicle::Imessage

Gem Version

Access your iMessage messages and attachments using the command line with this plugin for chronicle-etl.

Usage

# Install chronicle-etl and this plugin
$ gem install chronicle-etl
$ chronicle-etl plugins:install imessage

# Load messages from the last week
$ chronicle-etl --extractor imessage --schema chronicle --since 1w

# Of the latest 1000 messages received, who were the top senders?
$ chronicle-etl -e imessage --schema chronicle --limit 1000 --fields agent.name | sort | uniq -c | sort -nr

Available Connectors

Extractors

message

Extractor for importing messages and attachments from local macOS iMessage install (via local cache at ~/Library/Messages/chat.db)

Settings
  • input: (default: ~/Library/Messages/chat.db) Local iMessage sqlite database
  • load_attachments: (default: false) Whether to load message attachments
  • only_attachments: (default: false) Whether to load only messages with attachments

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:

  • my_phone_number: Your phone number (for setting messages's actor fields properly)
  • my_name: Your name (for setting messages's actor fields properly)
  • icloud_account_id: Specify an email address that represents your iCloud account ID
  • icloud_account_dsid: Specify iCloud DSID
    • Can find in Keychain or by running $ defaults read MobileMeAccounts Accounts

chronicle-imessage's People

Contributors

hyfen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

chronicle-imessage's Issues

Read all local address books in searching for contact names

We use the sqlite databases in ~/Library/Application Support/AddressBook to try and guess names of message senders.

Right now, we only use the first database we find in Sources/ but we should expand the search to include all available databases including the local database (~/Library/Application Support/AddressBook/AddressBook-v22.abcddb).

Find better way to figure out own name/number

Currently, ImessageTransformer needs config passed in to build your own name/number. Ideally, we need a more automated way of determining this information.

For iCloud, we can use what we did with Safari to detect currently logged in iCloud account: https://github.com/chronicle-app/chronicle-safari/blob/0252fab1d882bd3b491059ccec61610721b33653/lib/chronicle/safari/safari_extractor.rb#L44.

For SMS, we still need would need an automated way to determine your own phone number. It should be possible to find in chat.db but needs more sleuthing.

The name/phone settings should still exist as an override in case you're extracting from a chat db that's not associated with your logged in iCloud account.

Don't crash if icloud account/phone can't be inferred

The extractor uses the LocalContacts module to try and infer information about a user's icloud account and phone number (via local Address Book sqlite dbs). If these details can't be found and no options are passed in manually (via my_phone_number setting, etc), the extractor should raise an exception instead of crashing.

This was encountered by @wongjustin99 in #chronicle-etl/33:

Beginning job
/Users/goose/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/chronicle-imessage-0.2.3/lib/chronicle/imessage/imessage_extractor.rb:61:in `load_my_phone_contact': undefined method `fetch' for nil:NilClass (NoMethodError)

          phone_number: @config.my_phone_number || local_contacts.my_phone_contact.fetch(:phone_number),
                                                                                  ^^^^^^
        from /Users/goose/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/gems/chronicle-imessage-0.2.3/lib/chronicle/imessage/imessage_extractor.rb:51:in `prepare_data'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.