wx_mediareqs_referer: Mediarequest counts per referer

Description Usage Arguments Value Media Limitations License See Also Examples

View source: R/mediareqs.R

Description

Daily and monthly aggregation of hits to media files, split by the referrer Referrer means either external, internal, unknown, or any Wikimedia wiki that the resource was requested from.

Usage

1
2
3
4
5
6
7
8
wx_mediareqs_referer(
  referer,
  media_type = c("all", "image", "video", "audio", "document", "other"),
  agent_type = c("all", "user", "bot"),
  granularity = c("daily", "monthly"),
  start_date = "20191201",
  end_date = "20200101"
)

Arguments

referer

The place that the request was made from. It can be any Wikimedia project (e.g. de.wikipedia), "all", "internal", "external", "search-engine", "unknown" or "none".

media_type

The media type that each file belongs to. It can be image, audio, video, document, or other. Default is "all" media types. See Media section below.

agent_type

If you want to filter by agent type, use "user", "bot"/"spider", or "automated" (refer to wikitech:Analytics/Data Lake/Traffic/BotDetection). If you are interested in pageviews regardless of agent type, use "all" (default).

granularity

The time unit for the response data. As of today, supported values are daily (default) and monthly.

start_date

The date of the first day to include, in YYYYMMDD format. Can also be a Date or a POSIXt object, which will be auto-formatted.

end_date

The date of the last day to include, in YYYYMMDD format. Can also be a Date or a POSIXt object, which will be auto-formatted.

Value

A tibble data frame with the following columns:

project

project

date

Date; beginning of each month if granularity = "monthly"

requests

number of media file requests

Media

File types are obtained by parsing the file extension, and then classified according to the following table:

Extensions Media type
svg, png, tiff, tiff, jpeg, jpeg, gif, xcf, webp, bmp image
mp3, ogg, oga, flac, wav, midi, midi audio
webm, ogv video
pdf, djvu, srt, txt document
(all other extensions) other

Limitations

License

Data retrieved from the API endpoint is available under the CC0 1.0 license.

See Also

Other content data & metrics: wx_edited_pages(), wx_mediareqs_file(), wx_most_requested_files(), wx_new_pages(), wx_page_edits(), wx_project_edits(), wx_top_edited_pages(), wx_total_pages()

Other mediarequests data & metrics: wx_mediareqs_file(), wx_most_requested_files()

Examples

1
wx_mediareqs_referer("de.wikipedia", granularity = "monthly")

bearloga/waxer documentation built on Nov. 28, 2020, 11:28 p.m.