npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fb-extract

v0.0.2

Published

A tool for extracting your messages from facebook.zip

Downloads

5

Readme

Tool for extracting information out of facebook.zip

Facebook appearently allows you to download your data in a .zip-file (try it here). Sadly, the files are in HTML and are meant to be viewed in a web browser; the raw data is hard to consume. Then, this repository happened.

fb-extract is a CLI that extracts your facebook data (messages) from HTML into JSON/CSV. Using this tool, you get the power to do whatever you want with your precious data. Word completetion, a chatbot that uses your expressions, machine learning etc. Endless possibilities! With your own data! Yay!

Anyhow, my conversion is probably not perfect. If you feel like something is lost in the conversion, file up an issue.

These platforms/databases/languages are tested so far:

  • Linux/PostgreSQL/Swedish

I have no idea if this tool works at all with any language other than Swedish, and I have currently no way of testing that. As such, PR are very welcome :)

NOTE! Your language has to be in this repository to convert timestamps correctly. The timestamps looks like "den 10 november 2013 kl. 10:18 UTC+01" and are thus impossible to convert without a locale. If your language isn't supported, timestamps will be recorded as null.

Installation

npm i -g fb-extract

Usage

Unzip facebook.zip that you downloaded from here, then run fb-extract /path/to/facebook_dir.

The tool will now ask you for your language the first time you run it. This is to make sure that timestamps are converted properly. The config is stored in ~/.config/fb-extract-nodejs/config.json. If interrupted, the tool restarts at where it left off by scanning the JSON-dir.

Converting long conversations takes quite a long time compared to short ones. Go ahead and take a coffee or two.

The tool creates two new folders in /path/to/facebook_dir

.
├── csv
└── json

where files are placed accordingly.

If you wan't to play around with TensorFlow, you're all set. Just use the csv-files.

If you wan't to have your messages in your database however, you should run psql < csv/import.sql (or execute csv/import.sql in some way on your database)

Tables

Columns in italics indicate a foreign key referencing another table key.

chats

| Column | Type | | --------- |--------| | cid | serial | | chat_name | text |

messages

| Column | Type | | --------- |--------| | mid | serial | | cid | integer| | uid | integer| | content | text | | media | text | | timestamp | timestamp without time zone |

participants

| Column | Type | | --------- |--------| | pid | serial | | uid | integer| | cid | integer|

users

| Column | Type | | --------- |--------| | uid | serial | | name | text |

reactions

| Column | Type | | --------- |--------| | rid | serial | | mid | integer| | uid | integer| | emoji | integer|

Example queries

Found under examples/

License

MIT