Created
March 10, 2010 20:22
-
-
Save janxious/328331 to your computer and use it in GitHub Desktop.
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 is a simple sinatra feedburner proxy. This technique can be used for getting around firewalls and things of that nature. | |
To use it, you can just `ruby feedburner_proxy.rb` at the cli and then navigate to `http://localhost:4567/FEED_URL`. | |
e.g. `http://localhost:4567/expectedbehavior` or `http://localhost:4567/jqr`, which will then pull down | |
'http://feeds2.feedburner.com/expectedbehavior' and 'http://feeds2.feedburner.com/jqr', respectively. | |
You can check it out at: http://high-spring-46.heroku.com |
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
require 'feedburner_proxy' | |
run Sinatra::Application |
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
require 'rubygems' | |
require 'sinatra' | |
require 'net/http' | |
require 'uri' | |
get '/' do | |
content_type :html | |
"Nothing to see here." | |
end | |
mime :xml, 'application/xml' | |
before do | |
content_type :xml | |
end | |
get /(.*)/ do | |
feed_base_url = URI.parse('http://feeds2.feedburner.com') | |
res = Net::HTTP.start(feed_base_url.host, feed_base_url.port) {|http| | |
http.get params[:captures].first | |
} | |
res.body | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment