MCPcopy Index your code
hub / github.com/averagesecurityguy/scrape

github.com/averagesecurityguy/scrape @3.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.3.0 ↗ · + Follow
70 symbols 146 edges 13 files 6 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Scrape

Scrape finds interesting data in text files using keyword searches and regular expressions. Scrape pulls text files from Pastebin and Github Gists. In addition, Scrape can parse text files in a local directory. The search terms are user configurable and are stored in the config.json file. Scrape can run in the background as a service or it can run on demand.

Sources

Pastebin

To use scrape without getting blacklisted at Pastebin.com you will need to get a Lifetime Pro membership and whitelist your IP address. Scrape implements Pastebin's recommended scraping logic, which is defined at https://pastebin.com/api_scraping_faq.

Gists

To use scrape with Github Gists, you will need to create a read-only Github API key. Scrape gets the 100 most recent gists using the API endpoint described at: https://developer.github.com/v3/gists/#list-all-public-gists. At this time, no attempt is made to download truncated files or truncated content.

Local Files

To use scrape to parse files in a local directory, define the directory in the config.json file. Scrape will parse the files in batches of 100 by default. The batch size is configurable in the config.json file. Keep in mind, that after a file is processed it will be deleted from the directory.

Installation

You will first need to clone the Git repository with git clone https://github.com/averagesecurityguy/scrape. Once you have downloaded the repository, run the setup.sh script from the repository with sudo permissions. This will generate a new user called scrape and install the service.sh init script. If you already have a service account you want to use on your machine, modify the setup.sh script to disable creating the new account and modify service.sh to use the account you want..

Viewing Gathered Data

While scrape is running you can visit https://127.0.0.1:5000 to view the data that has been gathered. You will need to create a TLS certificate and key and define their locations in the config.json file. When scrape is not runnig you can use the view tool in the install directory to view scrape data.

View Command Usage

Usage:
    view filename action [arguments]

Actions:
    buckets                       Get a list of buckets.
    read <bucketname> <key>       Get the value of the key in the bucket.
    keys <bucketname>             Get a list of keys in a bucket.
    vals <bucketname>             Get a list of values in a bucket.
    search <bucketname> <string>  Get a list of keys from the bucket where the
                                  value contains the given string.

Extension points exported contracts — how you extend this code

WalkFunc (FuncType)
(no doc)
store.go
WalkFunc (FuncType)
(no doc)
view/store.go

Core symbols most depended-on inside this repo

help
called by 6
view/view.go
Write
called by 4
process.go
getGithub
called by 4
get.go
NewDataSet
called by 3
web.go
CreateBucket
called by 3
store.go
ReadBatch
called by 3
store.go
Json
called by 3
process.go
get
called by 3
get.go

Shape

Function 32
Method 18
Struct 18
FuncType 2

Languages

Go99%
TypeScript1%

Modules by API surface

web.go12 symbols
store.go10 symbols
view/view.go7 symbols
view/store.go7 symbols
process.go7 symbols
github.go7 symbols
scrape.go4 symbols
gist.go4 symbols
config.go4 symbols
paste.go3 symbols
get.go3 symbols
web/static/scrape.js1 symbols

For agents

$ claude mcp add scrape \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact