camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel RSS Component and ? char in URL feed
Date Fri, 16 Mar 2012 17:58:42 GMT
The ? indicates the start of the query of the uri
http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax

So in your case you should use & to separate values, so it should be:
 rss:http://unevieagrimper.blogspot.com/feeds/posts/default?alt=rss&splitEntries=false&consumer.delay=1000


On Fri, Mar 16, 2012 at 6:40 PM, olivierursushorribilis
<olivierursushorribilis@gmail.com> wrote:
> Hi,
>
> my RSS feed URL is :
> http://unevieagrimper.blogspot.com/feeds/posts/default?alt=rss
>
> To me, this URL is quite valid : many RSS feed (thousands !) are using such
> URL suffix (?xx=xx).
>
> When i try to use Camel RSS Component i get an error :
>
> rss:http://unevieagrimper.blogspot.com/feeds/posts/default?alt=rss?splitEntries=false&consumer.delay=1000
>
> Since ? is a special char for camel URI it causes trouble.
>
> Then, i tried :
>
> rss:http://unevieagrimper.blogspot.com/feeds/posts/default%3Falt=rss?splitEntries=false&consumer.delay=1000
>
>
> But, it does not work since %3F is not decoded when Camel RSS tries to get
> data from this URL.
>
> What is the proper way to get Camel RSS working with this URL ?
>
>
> I've patched (quick and dirty for testing purpose) the
> org.apache.camel.component.rss.RssUtils class :
>
>
> package org.apache.camel.component.rss;
>
> import java.io.InputStream;
> import java.net.URL;
>
> import com.sun.syndication.feed.synd.SyndFeed;
> import com.sun.syndication.io.SyndFeedInput;
> import com.sun.syndication.io.XmlReader;
>
> public final class RssUtils {
>    private RssUtils() {
>        // Helper class
>    }
>
>    public static SyndFeed createFeed(String feedUri) throws Exception {
>        String uri = feedUri;
>        if(feedUri.contains("%3F")){
>            uri = feedUri.replace("%3F","?");
>        }
>        InputStream in = new URL(uri).openStream();
>        SyndFeedInput input = new SyndFeedInput();
>        return input.build(new XmlReader(in));
>    }
> }
>
> The patch handle the encoded %3F.
>
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-RSS-Component-and-char-in-URL-feed-tp5572015p5572015.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message