Archive Gab.ai posts from the command line
Project description
garc
Garc is a python library and command line tool for collecting JSON data from Gab.ai
Garc is built based on the wonderful twarc project published by the Documenting the Now project. Inspiration for structure, usage and outputs are from twarc, and garc is intended to be used for similar purposes.
Garc is still very much a work in progress, and is being constantly updated to add deeper functionality and as new features and changes are implemented by Gab.
Warnings
Gab's api is relatively sparsely documented, so things may change without warning and break searches.
Please be respectful when using this and any data collection software, try not to make excessive searches and calls.
Installation
There are two options for installing garc.
- From pypi the official python package repository, which will always have the most stable release:
pip install garc
- Directly from Github, which will have the newest release:
pip install git+git://github.com/ChrisStevens/garc.git
Usage
Configure
First you need to give garc your account information:
garc configure
You only need the username and password for your account created at Gab.ai. Without an account you won't be able to interact with the api, or get any results from garc.
Search
Using the Gab search API you can collect posts based on a search term. As Gab's API is mostly undoumented it is hard to know exactly what the searches return (it is however the same data as appears on the Gab website for a search). Initial tests have found matches for the search term in both the post body and the users description, and the search uses some type of fuzzy matching or word stemming, as matches for not exact terms have shown up.
A simple call
garc search maga
Will return as many historical gabs as are available (usually around 9000 irrespective of post dates).
You can also limit the number of returns with the --number_gabs parameter
garc search maga --number_gabs=100
Which will return approxiately 100 of the most recent posts.
User Posts
Another way to collect posts is by collecting all the posts made by a single user
garc userposts fakeusername
As some users have a large number of posts this can take a long time to collect the entirey of a users timeline. Additional there are both number and time filters you can pass to limit the number of posts.
garc userposts fakeusername --number_gabs=100
Will return aproximately 100 posts from the top of a users timeline
garc userposts fakeusername --gabs_after=2018-05-12
Will return all gabs from after 2018-05-12
User info
You can also collect the information of a user
garc user fakeusername
Which will return a json object of information about the user
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file garc-1.1.3.tar.gz
.
File metadata
- Download URL: garc-1.1.3.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96623f1ff5b5c31b86ac04336bbb9ffecb9a82980be29ee84d275d9dff162261 |
|
MD5 | 4b3a0cb01031e35ad70ddd00bb63de6d |
|
BLAKE2b-256 | 4aac146828746e553f7fcc28b29db78668b5931a9edecbc00e0e62c43ffb18e5 |
File details
Details for the file garc-1.1.3-py2-none-any.whl
.
File metadata
- Download URL: garc-1.1.3-py2-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7182ff84397f2008435ac32e753884c057734b786d4c997f61f99f9904645a7d |
|
MD5 | 9da3f3bc4af682de9dc28747535412d0 |
|
BLAKE2b-256 | 8108efaff4511dd8730ff8cbee13bbbbddd433b48fd9514baf3242e56b4490ef |