Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
  • 11 commits
  • 4 files changed
  • 0 commit comments
  • 3 contributors
Commits on Sep 14, 2012
Update README.md
Added documentation for /api/authenticate/forgot_password
Commits on Sep 19, 2012
Update README.md
Updated forgot password doc.
Commits on Sep 10, 2014
[#17373] Login from games.bleacherreport.com is failing
use the httparty response code method instead of inspecting the headers
directly
Commits on Sep 11, 2014
Commits on Sep 16, 2014
Showing with 39 additions and 7 deletions.
  1. +31 −0 README.md
  2. +1 −1 config/gemspec.yml
  3. +4 −4 lib/bleacher_api.rb
  4. +3 −2 lib/bleacher_api/config.rb
View
@@ -18,6 +18,7 @@ Table of Contents
* [POST /api/authenticate/login.json](#authenticate_login_post)
* [GET /api/authenticate/logout.json](#authenticate_logout)
* [GET /api/authenticate/signup](#authenticate_signup)
+* [POST /api/authenticate/forgot_password](#authenticate_forgot_password)
* [GET /api/front/lead_articles.json](#front_lead_articles)
* [GET /api/front/v2/lead_articles.json](#front_lead_articles_v2)
* [GET /api/geolocation/teams.json](#geolocation_teams)
@@ -163,6 +164,36 @@ http://bleacherreport.com/api/authenticate/signup?redirect_url=http://bleacherre
A `redirect_url` parameter is mandatory. B/R will redirect the request back to that URL, passing basic information
from the <a href="#user_user">User API</a> as GET parameters.
+<a name="authenticate_forgot_password"></a>
+
+POST /api/authenticate/forgot_password
+----------------------------
+
+### Parameters
+
+* email
+* redirect_url (optional)
+* format (optional) - json or not
+
+### Returns
+
+Either json of success/error, html status of 200 or 404 (for ajax), or redirect.
+
+### HTTP Example
+
+<pre>
+http://bleacherreport.com/api/authenticate/forgot_password.json?email=bherman@bleacherreport.com
+</pre>
+
+### Paramter Info
+
+Email parameter is mandatory.
+
+If requesting json, redirect_url will be ignored. If non-json and redirect_url, the request will be treated as html and redirect to the specified url.
+If no params, it will be treated as an html request, but only return a status code of 200 for success or 404 for error (which could be an inability to find the email or any other error).
+
+On success, a forgot password email will be triggered.
+
<a name="front_lead_articles"></a>
GET /api/front/lead_articles.json
View
@@ -1,5 +1,5 @@
name: bleacher_api
-version: 0.1.2
+version: 0.1.5
authors:
- Bleacher Report
email: wwelsh@bleacherreport.com
View
@@ -12,12 +12,12 @@ class BleacherApi
include HTTParty
class <<self
- def call(type, path, data=nil)
- base_uri BleacherApi::Config.url
+ def call(type, path, data=nil, ssl=false)
+ base_uri BleacherApi::Config.url(nil, ssl)
data, old_data = {}, data
data[type == :get ? :query : :body] = old_data
output = send(type, "/api/#{path}.json", data)
- if output.headers['status'].include?('200')
+ if output.code == 200
output
else
false
@@ -40,7 +40,7 @@ def login(email, password, redirect=nil)
'user[email]' => email,
'user[password]' => password,
'redirect' => nil
- })
+ }, true)
if result
BleacherApi::Config.token result['token']
end
@@ -2,9 +2,10 @@ class BleacherApi
module Config
class <<self
- def url(url=nil)
+ def url(url=nil, ssl=false)
@url = url unless url.nil?
- @url || 'http://bleacherreport.com'
+ protocol = ssl ? 'https' : 'http'
+ @url || "#{protocol}://bleacherreport.com"
end
def token(token=nil)

No commit comments for this range