{"id":22305172,"url":"https://github.com/usccana/socnet","last_synced_at":"2025-10-14T00:30:49.434Z","repository":{"id":88621190,"uuid":"111744890","full_name":"USCCANA/socnet","owner":"USCCANA","description":"Web Scraping The Social Networks (SOCNET) Listserv","archived":false,"fork":false,"pushed_at":"2022-08-16T17:14:15.000Z","size":3167,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T20:25:40.835Z","etag":null,"topics":["rpackage","rstats","sna","social-network-analysis","webscraping"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/USCCANA.png","metadata":{"files":{"readme":"README.Rmd","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-23T00:17:33.000Z","updated_at":"2024-07-19T12:24:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"2301903d-955c-48b8-a6d7-b0c90c3e34c6","html_url":"https://github.com/USCCANA/socnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/USCCANA/socnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCCANA%2Fsocnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCCANA%2Fsocnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCCANA%2Fsocnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCCANA%2Fsocnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USCCANA","download_url":"https://codeload.github.com/USCCANA/socnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCCANA%2Fsocnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017353,"owners_count":26086052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rpackage","rstats","sna","social-network-analysis","webscraping"],"created_at":"2024-12-03T19:10:14.865Z","updated_at":"2025-10-14T00:30:48.881Z","avatar_url":"https://github.com/USCCANA.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n[![Travis build status](https://travis-ci.org/USCCANA/socnet.svg?branch=master)](https://travis-ci.org/USCCANA/socnet)\n [![Coverage status](https://codecov.io/gh/USCCANA/socnet/branch/master/graph/badge.svg)](https://codecov.io/github/USCCANA/socnet?branch=master)\n\n# socnet\n\nThis R package is created to access the data available in the\nSOCNET website https://lists.ufl.edu/cgi-bin/wa?A0=SOCNET, which is hosted\nby The University of Florida in its Listserv website.\n\n## Installation\n\nThis package is currently under develoment and is only available by downloading the bleeding edge version. You can use `devtools` to get it:\n\n```r\ndevtools::install_github(\"USCCANA/socnet\")\n```\n\n\n## Example\n\nBefore starts, let's first load the package.\n\n```{r}\nlibrary(socnet)\n```\n\nSuppose that you want to look at the SOCNET archives, but you don't know from where to start. You can use the function `socnet_list_archives` to get a list of the archives that are available in the Listserv. \n\n```{r example-archives}\n# Getting the URLs to the archives per month\narchives \u003c- socnet_list_archives(cached = TRUE)\nhead(archives)\n```\n\nNow that we have the list of archives, we can access one of them and list what are the subjects (emails) that show under that archive with the `socnet_list_subjects` function.\n\n```{r example-subjects}\n# What was discussed during Oct 17?: Getting the subjects during that time\nsubjects \u003c- socnet_list_subjects(archives$url[1], cached = TRUE)\n```\n\nLet's take a look at the output\n\n```{r}\nstr(subjects)\nhead(subjects[,-1])\n```\n\nNow, we can use the function `socnet_parse_subject` to actually get the data of a particular subject. Let's try with the subject titled ``r subjects$subject[1]``\n\n```{r example-fetch-subject}\nsocnet_parse_subject(subjects$url[1])\n```\n\nAs you can see, the function returned a list with two elements, a vector of meta information, and the actual email.\n\n# Most active user (compose side)\n\n```{r}\nrankfun \u003c- function(x, colnames, maxn = 100) {\n  x \u003c- as.data.frame(table(x))\n  x \u003c- x[order(-x$Freq),]\n  dimnames(x) \u003c- list(1:nrow(x), colnames)\n  knitr::kable(x[1:maxn,], row.names = TRUE)  \n}\n\n# Getting the from column and removing weird characters\ndata(\"subjects\")\nfrom \u003c- subjects$from\nfrom \u003c- iconv(from, to=\"ASCII//TRANSLIT\")\n\n# Removing \u003c[log in to unmask]\u003e message\nfrom \u003c- tolower(gsub(\"[\u003c].+\", \"\", from))\n\n# Fixing some names...\nregexp \u003c- \"Th?om(as)?( W)?\\\\.? Valente\"\nfrom[grepl(regexp, from, ignore.case = TRUE)] \u003c- \"Thomas W. Valente\"\n\nregexp \u003c- \"Valdis( Krebs)?\"\nfrom[grepl(regexp, from, ignore.case = TRUE)] \u003c- \"Valdis Krebs\"\n\nregexp \u003c- \"Steve Borgatti|Borgatti, Steve\"\nfrom[grepl(regexp, from, ignore.case = TRUE)] \u003c- \"Steve Borgatti\"\n\nregexp \u003c- \"Snijders, T\\\\.A\\\\.B\\\\.|Tom A\\\\.B\\\\. Snijders|T\\\\.A\\\\.B\\\\.Snijders\"\nfrom[grepl(regexp, from, ignore.case = TRUE)] \u003c- \"Tom Snijders\"\n\nregexp \u003c- \"Kathleen( M\\\\.)? Carley\"\nfrom[grepl(regexp, from, ignore.case = TRUE)] \u003c- \"Kathleen M. Carley\"\n\n# Capitalizing the first letter\n# I learned (copied) this from stackoverflow!\n# https://stackoverflow.com/questions/6364783/capitalize-the-first-letter-of-both-words-in-a-two-word-string\n# from \u003c- gsub(\"(^|[[:space:]])([[:alpha:]])\", \"\\\\1\\\\U\\\\2\", from, perl=TRUE)\nfrom \u003c- stringr::str_to_title(from)\n\n\n# Creating the table\nrankfun(from, colnames=c(\"User\", \"Count\"))\n```\n\n\n# Latest version of the cache data\n\n```{r, results='asis', echo=FALSE}\nreadLines(\"inst/cache/readme.md\", warn = FALSE)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusccana%2Fsocnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusccana%2Fsocnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusccana%2Fsocnet/lists"}