Module: Biostars::API
- Defined in:
- lib/biostars/api.rb,
lib/biostars/api/post.rb,
lib/biostars/api/user.rb,
lib/biostars/api/vote.rb,
lib/biostars/api/stats.rb,
lib/biostars/api/traffic.rb,
lib/biostars/api/version.rb
Overview
API wrapper for www.biostars.org public API
Defined Under Namespace
Classes: Post, Stats, Traffic, User, Vote
Constant Summary collapse
- API_URL =
Used for API requests
'https://www.biostars.org/api'
- VERSION =
Biostars::API Gem version.
"0.1.4"
Class Method Summary collapse
-
.get(url) ⇒ Hash
Used for general GET http requests to the API.
-
.traffic ⇒ Traffic
Number of post views over the last 60 min filtered by unique IPs.
Class Method Details
.get(url) ⇒ Hash
Used for general GET http requests to the API
41 42 43 44 |
# File 'lib/biostars/api.rb', line 41 def self.get(url) response = HTTParty.get "#{API_URL}/#{url}" response.success? ? JSON.parse(response.body) : false end |