pastebinner/lib/examples.rb
booboy eae20ccd0c started to work on the command line application
added
-- raw
-- scrape_public_pastes
-- list_trending (still broken though. need to fix the api call)
-- added a method to extract just the keys from public pastes
-- moved the previous tests to an examples.rb file

need to mess around with all the different ways to parse arguments for the
command line program.
2018-11-04 02:28:57 -06:00

29 lines
966 B
Ruby
Executable file

#!/usr/bin/env ruby
require './pastebinner'
######################## TESTING ####################################################
#####################################################################################
#### INITIAL STEPS
# setup our object and grab a session key
pb = Pastebinner.new(ENV['pastebin_api_key'], ENV['pastebin_username'], ENV['pastebin_password'])
api_dev_key = ENV['pastebin_api_key']
#### CREATE PASTE
# prepare some sample paste data to send
#paste_data = 'this is a test paste two two two.'
# prepare our paste params
#params = { "api_dev_key": api_dev_key, "api_option": "paste", "api_paste_code": paste_data }
#puts pb.create_paste(params)
#### SCRAPE PUBLIC PASTES
#puts pb.scrape_public_pastes
#### SCRAPING - WHITELISTED IP ONLY
#### SCRAPE RAW PASTE DATA OF A PASTE KEY
#puts pb.raw_paste_data('Gkb4ukK9')
#### SCRAPE RAW METADATA OF A PASTE KEY (WORKS WITH WHITELISTED IP ONLY)
#puts pb.raw_paste_metadata('Gkb4ukK9')