facebook_totem

Crates.iofacebook_totem
lib.rsfacebook_totem
version0.1.1
created_at2025-07-07 09:08:39.119177+00
updated_at2025-07-07 14:21:12.82109+00
descriptionA tool for extracting and analyzing Facebook post data
homepagehttps://github.com/jonaylor89/facebook_totem
repositoryhttps://github.com/jonaylor89/facebook_totem
max_upload_size
id1740911
size987,877
Johannes Naylor (jonaylor89)

documentation

https://docs.rs/facebook_totem

README

Facebook Totem

Educational purposes only

Facebook Totem allows you to retrieve information about ads of a Facebook page. You can retrieve the number of people targeted, how much the ad cost and a lot of other information.

Installtion

Building from Source

git clone https://github.com/jonaylor89/facebook_totem.git
cd facebook_totem/
cargo build --release

The compiled binary will be available at target/release/facebook_totem

Install with Cargo

cargo install --path .

Usage

facebook_totem <COMMAND> [OPTIONS] --output <OUTPUT>

Commands:
  single  Get all ads on a single page
  multi   Get ads on multiple pages from a CSV file
  search  Search for a page by name
  help    Print this message or the help of the given subcommand(s)

Options:
  -o, --output <OUTPUT>  Name of the CSV output file
  -h, --help             Print help
  -V, --version          Print version

Single Mode - Get ads from a single page

facebook_totem single --url <FACEBOOK_PAGE_URL> --output results.csv

Multi Mode - Get ads from multiple pages

facebook_totem multi --urls pages.csv --columns url_column --output results.csv

Search Mode - Search for pages by name

facebook_totem search --target "Page Name" --output search_results.csv

The output is saved in the output/ folder. For multi mode, each page gets its own file named with the page name and ID.

Testing

Run the comprehensive test suite:

cargo test

The test suite includes:

  • Unit tests for core parsing and CSV writing functions
  • Integration tests for CLI commands and workflows
  • Error handling tests for edge cases and invalid inputs
  • Mock data tests for testing with sample Facebook responses

Run tests with output:

cargo test -- --nocapture

Run specific test modules:

cargo test error_handling_tests
cargo test integration_with_mocks

Made with 🦀 Rust | Original Python version by megadose

Commit count: 0

cargo fmt