rails app that takes and stores pastes from pastebin
Find a file
2018-11-17 22:15:36 -06:00
bin made an error if only -k --key is passed 2018-11-17 19:04:12 -06:00
lib made the json encoding store metadata of a paste and the fulltext 2018-11-17 22:15:36 -06:00
spec initial commit 2018-08-16 14:54:08 -05:00
.gitignore wrote a method to download all the raw pastes to a file inside of a directory. 2018-11-05 03:15:29 -06:00
.rspec initial commit 2018-08-16 14:54:08 -05:00
.travis.yml initial commit 2018-08-16 14:54:08 -05:00
Gemfile fixed naming conventions and set this up to begin working on command line calls 2018-08-22 15:03:42 -05:00
LICENSE Initial commit 2018-08-16 14:52:20 -05:00
pastebinner.gemspec messed with the cmd line options, some work now 2018-11-04 02:59:25 -06:00
Rakefile initial commit 2018-08-16 14:54:08 -05:00
README.md typo 2018-11-10 04:48:51 -06:00
README.md.default made an actual readme to explain how to download pastes 2018-11-09 22:53:09 -06:00

Pastebinner

Check out the examples folder for some examples. I will add more soon.

Usage

Set the following environment variables:

pastebin_api_key
pastebin_username
pastebin_password

If you want to scrape pastes, you can view a json response of the latest pastes by using the -s or --scrape_public options. Creating pastes is built in, check lib/pastebinner.rb, I am still working on adding in the functionality to use it on the command line. The command line app can be used as follows:

pastebinner --help
Usage: pastebinner [options]
    -h, --help                       Show this help messae
    -s, --scrape_public              Scrape public pastes
    -r, --raw                        Raw paste. Requires --key passed with a valid key
    -g, --get_keys                   Get unique paste keys from public pastes
    -k, --key=                       Unique paste key
    -d, --download                   Download all public pastes to data directory
    -t, --trending                   Trending pastes

Downloading pastes

Create a directory in the git repo named data, this is where the raw pastes will be stored. Here is an example of what it looks like:

pastebinner --download
Downloading paste data into the data directory...
Complete.

The data directory will then be populated with pastebin raw paste files with the following naming scheme:

pastebin_paste_key_agiArDuG

where the last characters are the paste key for that specific paste.

To Add:

  • fulltext search of raw pastes via elastic search, mysql, postgres, sqlite, or some other method
  • create pastes from the command line
  • adding exceptions
  • adding configuration file support
  • adding rspec tests