scrapy_cloud_ex v0.1.2 ScrapyCloudEx.Endpoints.Storage.Activity View Source

Wraps the Activity endpoint.

Scrapinghub keeps track of certain project events such as when spiders are run or new spiders are deployed. This activity log can be accessed in the dashboard by clicking on Activity in the left sidebar, or programmatically through the API in this module.

Link to this section Summary

Functions

Retrieves messages for the specified project

Retrieves messages for multiple projects

Link to this section Types

Link to this type event_object() View Source
event_object() :: %{required(String.t()) => String.t()}

An event.

Map with the following keys:

Other key-values may be present as relevant to the "event" type.

Link to this section Functions

Link to this function list(api_key, project_id, params \\ [], opts \\ []) View Source

Retrieves messages for the specified project.

Results are returned in reverse order.

The following parameters are supported in the params argument:

The opts value is documented here.

See docs here (GET method).

Example

ScrapyCloudEx.Endpoints.Storage.Activity.list("API_KEY", "123", count: 10)
Link to this function projects(api_key, params \\ [], opts \\ []) View Source

Retrieves messages for multiple projects.

Results are returned in reverse order.

The following parameters are supported in the params argument:

  • :format - the format to be used for returning results. Must be one of :json, :csv, :jl, :xml. Defaults to :json. See more about formats in ScrapyCloudEx.Endpoints.Storage.

  • :pagination - pagination parameters.

  • :meta - meta parameters to add to each result. Supported values: :_project, :_ts.

  • :p - project id. May be given multiple times.

  • :pcount - maximum number of results to return per project.

The opts value is documented here.

See docs here.

Example

params = [p: "123", p: "456", pcount: 15, pagination: [count: 100], meta: [:_ts, :_project]]
ScrapyCloudEx.Endpoints.Storage.Activity.projects("API_KEY", params)