diff --git a/Gemfile b/Gemfile index 7462a8e..6f07931 100644 --- a/Gemfile +++ b/Gemfile @@ -3,4 +3,5 @@ source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } # Specify your gem's dependencies in pastebinner.gemspec +rest-client gemspec diff --git a/lib/pastebinner.rb b/lib/pastebinner.rb index 901f4f9..bae74c3 100755 --- a/lib/pastebinner.rb +++ b/lib/pastebinner.rb @@ -59,7 +59,25 @@ module Pastebin params = { 'api_dev_key': @api_dev_key, 'api_user_key': @api_user_key, 'api_results_limit': '100', - 'api_option': 'list'} + 'api_option': 'list' + } + execute_query(:api_post, params) + end + + def list_trending_pastes + params = { 'api_dev_key': @api_dev_key, + 'api_option': 'trend' + } + execute_query(:api_post, params) + end + + # api_paste_key = this is the unique key of the paste data you want to delete. + def delete_user_paste(api_paste_key) + params = { 'api_dev_key': @api_dev_key, + 'api_user_key': @api_user_key, + 'api_paste_key': api_paste_key, + 'api_option': 'delete' + } execute_query(:api_post, params) end diff --git a/pastebinner.gemspec b/pastebinner.gemspec index a1a3e34..c469219 100644 --- a/pastebinner.gemspec +++ b/pastebinner.gemspec @@ -9,9 +9,8 @@ Gem::Specification.new do |spec| spec.authors = ["booboy"] spec.email = ["bpmcdevitt@thelinuxspace.com"] - spec.summary = %q{TODO: Write a short summary, because RubyGems requires one.} - spec.description = %q{TODO: Write a longer description or delete this line.} - spec.homepage = "TODO: Put your gem's website or public repo URL here." + spec.summary = "A ruby client library for interacting with the pastebin API." + spec.homepage = "https://github.com/booboy/pastebinner" # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' # to allow pushing to a single host or delete this section to allow pushing to any host. @@ -34,4 +33,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.16" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.0" + spec.add_development_dependency "rest-client", "~> 2.0" end