Browse Source

initial commit

master
boB Rudis 3 years ago
parent
commit
4ccfb3fde0
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 1
      .Rbuildignore
  2. 8
      DESCRIPTION
  3. 2
      LICENSE
  4. 21
      LICENSE.md
  5. 1
      NAMESPACE
  6. 37
      R/darkdumpr.R
  7. 6
      README.Rmd
  8. 92
      README.md
  9. 23
      man/search_noir.Rd

1
.Rbuildignore

@ -19,3 +19,4 @@
^CRAN-RELEASE$ ^CRAN-RELEASE$
^appveyor\.yml$ ^appveyor\.yml$
^tools$ ^tools$
^LICENSE\.md$

8
DESCRIPTION

@ -1,6 +1,6 @@
Package: darkdumpr Package: darkdumpr
Type: Package Type: Package
Title: darkdumpr title goes here otherwise CRAN checks fail Title: Query darkdump.io for Dark Web Content
Version: 0.1.0 Version: 0.1.0
Date: 2021-02-13 Date: 2021-02-13
Authors@R: c( Authors@R: c(
@ -8,15 +8,15 @@ Authors@R: c(
comment = c(ORCID = "0000-0001-5670-2640")) comment = c(ORCID = "0000-0001-5670-2640"))
) )
Maintainer: Bob Rudis <bob@rud.is> Maintainer: Bob Rudis <bob@rud.is>
Description: A good description goes here otherwise CRAN checks fail. Description: Query darkdump.io for Dark Web Content.
URL: https://git.rud.is/hrbrmstr/darkdumpr URL: https://git.rud.is/hrbrmstr/darkdumpr
BugReports: https://git.rud.is/hrbrmstr/darkdumpr/issues BugReports: https://git.rud.is/hrbrmstr/darkdumpr/issues
Encoding: UTF-8 Encoding: UTF-8
License: AGPL License: MIT + file LICENSE
Suggests: Suggests:
covr, tinytest covr, tinytest
Depends: Depends:
R (>= 3.5.0) R (>= 3.6.0)
Imports: Imports:
httr, httr,
jsonlite jsonlite

2
LICENSE

@ -0,0 +1,2 @@
YEAR: 2021
COPYRIGHT HOLDER: Bob Rudis

21
LICENSE.md

@ -0,0 +1,21 @@
# MIT License
Copyright (c) 2021 Bob Rudis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1
NAMESPACE

@ -1,4 +1,5 @@
# Generated by roxygen2: do not edit by hand # Generated by roxygen2: do not edit by hand
export(search_noir)
import(httr) import(httr)
importFrom(jsonlite,fromJSON) importFrom(jsonlite,fromJSON)

37
R/darkdumpr.R

@ -0,0 +1,37 @@
.darkdumpr_ua <- "Mozilla/5.0 (Compatible; r-darkdumpr/1.0; https://gitlab.com/hrbrmstr/darkdumpr)"
#' Query darkdump.io for Dark Web Content
#'
#' @param query &lt;chr> terms to search (supports
#' [darkdump.io advanced search composition](https://darksearch.io/dorks)).
#' @param page pagination control
#' @return data frame with a "`metadata`" atttribute containing pagination info
#' @export
#' @examples
#' search_noir("ransomware")
search_noir <- function(query, page = 1) {
httr::GET(
url = "https://darksearch.io/api/search",
query = list(
query = query[1],
page = page[1]
),
httr::user_agent(.darkdumpr_ua)
) -> res
httr::stop_for_status(res)
out <- httr::content(res, as = "text", encoding = "UTF-8")
out <- jsonlite::fromJSON(out)
if (hasName(out, "data")) {
ret <- out$data
out$data <- NULL
attr(ret, "metadata") <- out
ret
} else {
out
}
}

6
README.Rmd

@ -39,6 +39,12 @@ packageVersion("darkdumpr")
``` ```
```{r ex-01}
res <- tibble::as_tibble(search_noir("ransomware"))
cat(res$description[1])
```
## darkdumpr Metrics ## darkdumpr Metrics
```{r cloc, echo=FALSE} ```{r cloc, echo=FALSE}

92
README.md

@ -0,0 +1,92 @@
[![Project Status: Active – The project has reached a stable, usable
state and is being actively
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/darkdumpr.svg?branch=master)](https://travis-ci.org/hrbrmstr/darkdumpr)
![Minimal R
Version](https://img.shields.io/badge/R%3E%3D-3.6.0-blue.svg)
![License](https://img.shields.io/badge/License-MIT-blue.svg)
# darkdumpr
Query darkdump.io for Dark Web Content
## Description
Query darkdump.io for Dark Web Content.
## What’s Inside The Tin
The following functions are implemented:
- `search_noir`: Query darkdump.io for Dark Web Content
## Installation
``` r
remotes::install_git("https://git.rud.is/hrbrmstr/darkdumpr.git")
# or
remotes::install_gitlab("hrbrmstr/darkdumpr")
# or
remotes::install_bitbucket("hrbrmstr/darkdumpr")
# or
remotes::install_github("hrbrmstr/darkdumpr")
```
NOTE: To use the ‘remotes’ install options you will need to have the
[{remotes} package](https://github.com/r-lib/remotes) installed.
## Usage
``` r
library(darkdumpr)
# current version
packageVersion("darkdumpr")
## [1] '0.1.0'
```
``` r
res <- tibble::as_tibble(search_noir("ransomware"))
cat(res$description[1])
## Surfacing The News From The DeepWeb
##
## Menu
##
## * Home
## * News & Articles
## * Markets List
## * Markets Chart
## * Vpn's Chart
## * Bitcoin Casinos
## * BTC Mixer
## * Q&A ~ Ask Here!
## * Videos
## * Contact Us
##
## Home » Articles » An overview of bitcoin <em>ransomware</em> attack campaigns
##
## # An overview of bitcoin
```
## darkdumpr Metrics
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
|:-----|---------:|-----:|----:|-----:|------------:|-----:|---------:|-----:|
| R | 3 | 0.38 | 26 | 0.36 | 8 | 0.16 | 17 | 0.18 |
| Rmd | 1 | 0.12 | 10 | 0.14 | 17 | 0.34 | 30 | 0.32 |
| SUM | 4 | 0.50 | 36 | 0.50 | 25 | 0.50 | 47 | 0.50 |
clock Package Metrics for darkdumpr
## Code of Conduct
Please note that this project is released with a Contributor Code of
Conduct. By participating in this project you agree to abide by its
terms.

23
man/search_noir.Rd

@ -0,0 +1,23 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/darkdumpr.R
\name{search_noir}
\alias{search_noir}
\title{Query darkdump.io for Dark Web Content}
\usage{
search_noir(query, page = 1)
}
\arguments{
\item{query}{<chr> terms to search (supports
\href{https://darksearch.io/dorks}{darkdump.io advanced search composition}).}
\item{page}{pagination control}
}
\value{
data frame with a "\code{metadata}" atttribute containing pagination info
}
\description{
Query darkdump.io for Dark Web Content
}
\examples{
search_noir("ransomware")
}
Loading…
Cancel
Save