You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Preben.Asmussen" <pr...@dr.dk> on 2013/05/01 21:17:37 UTC

using or operator in twitter keywords search

Just used the twitter component for a small demo, and stumbled on a missing
feature.

It would be nice if you where able to use or operator in the twitter
keywords option. Maybe even be able to combine and/or in keywords.
Should be possible in twitter4j, but i'm not sure.

Best,
Preben



--
View this message in context: http://camel.465427.n5.nabble.com/using-or-operator-in-twitter-keywords-search-tp5731873.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: using or operator in twitter keywords search

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Thanks for sharing that link to this search page.
I have added a note to the Camel twitter docs.

On Thu, May 9, 2013 at 10:42 PM, Bruno Borges <br...@gmail.com> wrote:
> Twitter has its own operators. Just use them in your "keywords" parameter:
>
> https://support.twitter.com/articles/71577-using-advanced-search
>
> The documentation might be misleading you to believe that you can only use
> comma-separated keywords. Actually, the keyword parameter value is passed
> directly to the Query object of Twitter4J:
>
>     public List<Tweet> pollConsume() throws TwitterException {
>         String keywords = te.getProperties().getKeywords();
>         Query query = new Query(keywords);
>         if (te.getProperties().isFilterOld()) {
>             query.setSinceId(lastId);
>         }
>         LOG.debug("Searching twitter with keywords: {}", keywords);
>         return search(query);
>     }
>
> Let me know if it helps.
>
>
> *Bruno Borges*
> (11) 99564-9058
> *www.brunoborges.com*
>
>
> On Thu, May 2, 2013 at 3:59 AM, Preben.Asmussen <pr...@dr.dk> wrote:
>
>> Created https://issues.apache.org/jira/browse/CAMEL-6332 so we don't
>> forget.
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/using-or-operator-in-twitter-keywords-search-tp5731873p5731887.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: using or operator in twitter keywords search

Posted by Bruno Borges <br...@gmail.com>.
Twitter has its own operators. Just use them in your "keywords" parameter:

https://support.twitter.com/articles/71577-using-advanced-search

The documentation might be misleading you to believe that you can only use
comma-separated keywords. Actually, the keyword parameter value is passed
directly to the Query object of Twitter4J:

    public List<Tweet> pollConsume() throws TwitterException {
        String keywords = te.getProperties().getKeywords();
        Query query = new Query(keywords);
        if (te.getProperties().isFilterOld()) {
            query.setSinceId(lastId);
        }
        LOG.debug("Searching twitter with keywords: {}", keywords);
        return search(query);
    }

Let me know if it helps.


*Bruno Borges*
(11) 99564-9058
*www.brunoborges.com*


On Thu, May 2, 2013 at 3:59 AM, Preben.Asmussen <pr...@dr.dk> wrote:

> Created https://issues.apache.org/jira/browse/CAMEL-6332 so we don't
> forget.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/using-or-operator-in-twitter-keywords-search-tp5731873p5731887.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: using or operator in twitter keywords search

Posted by "Preben.Asmussen" <pr...@dr.dk>.
Created https://issues.apache.org/jira/browse/CAMEL-6332 so we don't forget.



--
View this message in context: http://camel.465427.n5.nabble.com/using-or-operator-in-twitter-keywords-search-tp5731873p5731887.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: using or operator in twitter keywords search

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah I assume configuring from endpoint uri, we would need some syntax
to define if its OR AND etc.
eg we could have AND OR as prefix to tell if the keyword is AND or OR based.

keywords=AND Apache,AND Camel,OR Donkey

Or have multiple options (where keywords is AND based)
keywords=Camel,Apache
keywordsOr=Donkey

The current keywords is comma based, we could also have a syntax with
AND OR as tokens.

keywords=Apache AND Camel OR Donkey



On Wed, May 1, 2013 at 9:17 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> Just used the twitter component for a small demo, and stumbled on a missing
> feature.
>
> It would be nice if you where able to use or operator in the twitter
> keywords option. Maybe even be able to combine and/or in keywords.
> Should be possible in twitter4j, but i'm not sure.
>
> Best,
> Preben
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/using-or-operator-in-twitter-keywords-search-tp5731873.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen