title: "socialmediahandles" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{socialmediahandles} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8}


knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
if (!require(devtools)) install.packages("devtools")

devtools::install_github("snfagora/MapAgora")
library(MapAgora)

Social media handles

Social media posts help to investigate the public presence of organizations. However, there is no standard way of identifying the social media handles belonging to a given organization.

Here, we approach this problem by extracting social media handles from an organization's website. As a secondary strategy, we provide the functionality to search for social media handles using the Bing search application programming interface (API).

Twitter handle

Twitter handles are identified on a page by extracting all links on the page and then filtering for possible Twitter handles. If a handle can be found, some link cleanup is attempted before returning it.

# get MoveOn's twitter handle
tw_handle <- find_twitter_handle_from_org_page("https://moveon.org")

Facebook page

The find_facebook_page_from_org_page() function works similarly but looks for a Facebook page instead of a handle.

# get MoveOn's Facebook page
fb_page <- find_facebook_page_from_org_page("https://moveon.org")


snfagora/MapAgora documentation built on April 27, 2024, 8 a.m.