Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eef8b9c
commit 3bfaabe
Showing
67 changed files
with
1,931 additions
and
2,223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
class SourcesController < ApplicationController | ||
respond_to :json, :xml | ||
rescue_from Sources::Site::NoStrategyError, :with => :no_strategy | ||
|
||
def show | ||
@source = Sources::Site.new(params[:url], :referer_url => params[:ref]) | ||
@source.get | ||
@source = Sources::Strategies.find(params[:url], params[:ref]) | ||
|
||
respond_with(@source.to_h) do |format| | ||
format.xml { render xml: @source.to_h.to_xml(root: "source") } | ||
format.json { render json: @source.to_h.to_json } | ||
end | ||
end | ||
|
||
protected | ||
|
||
def no_strategy | ||
render json: {message: "Unsupported site"}.to_json, status: 400 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.