Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support for proxy, patch from Tom Meier. Closes #43

  • Loading branch information...
commit 3ec04f8facfad5d557e65480e5d5a95c5f054c4b 1 parent e44de3f
@archiloque archiloque authored
Showing with 4 additions and 2 deletions.
  1. +2 −2 README.rdoc
  2. +2 −0  lib/feedzirra/feed.rb
View
4 README.rdoc
@@ -103,8 +103,8 @@ If you're still having issues, please let me know on the mailing list. Also, {To
# the behavior for the handlers when using Feedzirra::Feed.update is slightly different. The feed passed into on_success will be
# the updated feed with the standard updated accessors. on failure it will be the original feed object passed into update
- # Defining custom parsers
- # TODO: the functionality is here, just write some good examples that show how to do this
+ # fetching a feed via a proxy (optional)
+ feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing", {:proxy_url => '10.0.0.1', :proxy_port => 3084})
=== Extending
View
2  lib/feedzirra/feed.rb
@@ -316,6 +316,8 @@ def self.add_feed_to_multi(multi, feed, feed_queue, responses, options)
curl.headers["If-Modified-Since"] = feed.last_modified.httpdate if feed.last_modified
curl.headers["If-None-Match"] = feed.etag if feed.etag
curl.userpwd = options[:http_authentication].join(':') if options.has_key?(:http_authentication)
+ curl.proxy_url = options[:proxy_url] if options.has_key?(:proxy_url)
+ curl.proxy_port = options[:proxy_port] if options.has_key?(:proxy_port)
curl.follow_location = true
curl.max_redirects = options[:max_redirects] if options[:max_redirects]
Please sign in to comment.
Something went wrong with that request. Please try again.