added a couple more api calls
This commit is contained in:
parent
9da7b16a6e
commit
eaf6207f22
3 changed files with 23 additions and 4 deletions
1
Gemfile
1
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue