Bonfire.Social.Graph.Import (Bonfire v1.0.0-social-rc.2.15)

View Source

Summary

Functions

Import follows, ghosts, silences, or blocks from a CSV file.

Import user's outbox from parsed JSON data.

Import user's outbox (posts and activities) from a JSON file.

Perform the queued job based on the operation and scope.

Perform an import operation for the scope.

Functions

import_from_csv_file(type, scope, path)

Import follows, ghosts, silences, or blocks from a CSV file.

Examples

iex> import_from_csv_file(:following, scope, "path/to/file.csv")

import_from_json(type, user_id, outbox_data, opts \\ [])

Import user's outbox from parsed JSON data.

import_from_json_file(type, user_id, path, opts \\ [])

Import user's outbox (posts and activities) from a JSON file.

Examples

iex> import_from_json_file("user_id", "path/to/outbox.json")
%{imported: 5, boosted: 3, errors: 1}

perform(map)

Perform the queued job based on the operation and scope.

Examples

iex> perform(%{args: %{"op" => "follows_import", "user_id" => "user1", "identifier" => "id1"}})
:ok

iex> perform(%{args: %{"op" => "blocks_import", "user_id" => "instance_wide", "identifier" => "id1"}})
:ok

perform(op, identifier, scope)

Perform an import operation for the scope.

Examples

iex> perform("follows_import", scope, "identifier")