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

grok-archiver

v0.9.3

Published

A cross platform archiver for X's Grok image generator.

Downloads

71

Readme

JLC's X's Grok Archiver

What is it?

It's an archiver for X's Grok AI generated images generated through its chat interface on the X website.

I am in no way affiliated with the people behind the X website (or the Grok AI) by the way! I am just a hobby programmer doing this work for free in my spare time!

How does it work?

It works by intercepting the communication between the browser (which MUST be Chromium based) and the X website to fetch the images and any related details.

It will fetch any new images you generate while the archiver is running and any images found in the chat history.

Why doesn't it work?

It you experience any bugs or it not working properly on your operating system this is because I am just one person developing this software and I have only tested it on my Linux PC.

I'll happily fix any bugs encountered, just create a new "issue" in the GitHub repository and document it there (and I'll probably figure out how to fix it soon).

Currently there is an issue which requires the DevTools panel to be open for it to work properly. Which is actually a Chromium bug!

How to run it?

You can run it using the Node.js package manager (NPM). To install NPM you'll have to install Node.js if you haven't done so already.

Then you should be able to run the archiver (in the current working directory) by typing:

npx grok-archiver

Which will try to setup the archive in the directory where you ran the command, if no "config.json" file was there already it will first create one and exit.

The "config.json" file it created looks something like this:

{
  "chromiumPath": "google-chrome",
  "archivePath": "the/absolute/path/to/the/directory"
}

On my Linux system "google-chrome" is the command which will launch my compatible browser. If you use macOS or Windows it will try to detect the path to Chrome. But please check that it got it right or manually enter the path to a Chromium based browser.

I suspect these values will work (if you use Chrome): | System | Path | | --- | --- | | macOS | ~/Library/Application Support/Google/Chrome | | Windows | C:\Program Files\Google\Chrome\Application\chrome.exe

Why must the browser be Chromium based?

This is because my archiver is using the Chrome DevTools Protocol to do its magic. This allows my program to easily intercept communication with their website.

What's the structure of the archive?

In the archive directory two directories will be created, which are named "database" and "images".

The images directory:

The "images" directory is where every image will be downloaded to. And they will be archived in subdirectories matching the creation date of the image.

The filenames will be formatted like this:

imageId-beginning_of_prompt.jpg

So a full path to an image could look like this:

archive_dir/2023/11/06/1826923980957102080-Photo-of-a-man….jpg

Any truncated prompt is followed by … (U+2026) to make it clear that it was truncated. This is done to avoid file-system errors due to too long filenames.

The database directory:

The "database" directory is where records are kept for every image which has been archived. This system allows you to delete or rename the downloaded images while still keeping a record to avoid them being re-downloaded.

Also more details about the images are stored in those records.

Looking up details for a specific image in the database is very easy to do using the search function in your file explorer. Just copy the "imageId" part of the image and search the database directory for the record (which is a .json file).

How do I support you?

I am at the moment chronically sick, without a job, with tons of debt, two kids and a wife (which I can't support economically). So please sponsor my efforts to develop and maintain a working solution like this, I would really appreciate it if you did! ❤️

The end (of the readme).

If you want to get in touch you can find me on X as HolyGodCow.