WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Gemfile for AlchemyAPI Ruby SDK
source "https://rubygems.org"
gem "json"
gem "httparty"
9 changes: 3 additions & 6 deletions alchemyapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@


require 'rubygems'
require 'net/http'
require 'uri'
require 'json'
require 'httparty'

class AlchemyAPI
include HTTParty

#Setup the endpoints
@@ENDPOINTS = {}
Expand Down Expand Up @@ -520,10 +520,7 @@ def analyze(url, options)
options['outputMode'] = 'json'

#Fire off the HTTP request
res = Net::HTTP::post_form(URI.parse(url), options)

#parse and return the response
return JSON.parse(res.body)
self.class.post(url, body: options).parsed_response
end
end

Expand Down