Skip to content

Instantly share code, notes, and snippets.

@janxious
Created March 10, 2010 20:22
Show Gist options
  • Save janxious/328331 to your computer and use it in GitHub Desktop.
Save janxious/328331 to your computer and use it in GitHub Desktop.
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
require 'feedburner_proxy'
run Sinatra::Application
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