Giter Site home page Giter Site logo

messenger-parser's Introduction

Messenger-Parser

I spend a lot of time on Messenger and I believe that small extentions can not only improve my conversations on the site but teach me to have better conversations in general - offline and online.

So that's why I'm open-sourcing Messenger Parser, so that we can all figure out the hard parts of conversation together.

This bare-bones script parses messenger conversations (via the dom) and converts them into an array of json objects like so:

[
  {
    msg: "This is a text",
    person: "Curtis",
    timeSent: "10:19pm",
    type: "text"
  },
  {
    person: "Curtis",
    timeSent: "10:20pm",
    type: "img"
  }
]

Note: open up the js console in Chrome to see the messages parsed by this extension.

Features:

  • Can detect images, attachments, and text messages.
  • Can detect when someone in the chat sends a message.
  • A reload button to reparse the entire dom at once.
  • A beautiful show/hide button that will make

Known bugs:

  • Sometimes when someone (that isn't you) sends a message, the event listener doesn't pick it up.

TODO:

  • The ability to convert the Messenger timestamps into a UTC date.
  • I've looked at the DOM and there only seems to be 3 cases for the types of dates that needs to be parsed. So it shouldn't be too hard.

Installation

First you'll need to install the dependencies. We can do this by downloading the js dependency files from CDNs using curl.

curl https://code.jquery.com/jquery-3.3.1.min.js > dependencies/jquery-3.3.1.min.js

Now follow the advice from Thoughbot:

To load your extension in Chrome, open up chrome://extensions/ in your browser and click “Developer mode” in the top right. Now click “Load unpacked extension…” and select the extension’s directory. You should now see your extension in the list.
When you change or add code in your extension, just come back to this page and reload the page. Chrome will reload your extension.

Development Notes (please read if you haven't made a chrome extension before!):

I would highly recommend by starting with: https://thoughtbot.com/blog/how-to-make-a-chrome-extension

This will get you acquainted with the restrictions (and work arounds) that you'll face when writing Chrome extensions.

Next you should get the Extensions Reloader chrome extension. This will toggle your extension off/on when you click the icon in your extensions bar. Use this everytime you make a change to your code or you won't see the updates!

Warning

If you change the manifest.json you must manually turn off/on the extension in chrome://extensions/ or your changes won't propagate. Extensions Reloader will not work for manifest changes.

messenger-parser's People

Contributors

curtischong avatar

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.