vignettes/getting-social-media-handles.Rmd
getting-social-media-handles.Rmd
if (!require(devtools)) install.packages("devtools")
devtools::install_github("snfagora/MapAgora")
library(MapAgora)
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 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")
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")