Pregunta

I am using RestFB to search multiple terms on Facebook. I am using following code to achieve that.

Connection<Post> publicSearch = publicOnlyFacebookClient
            .fetchConnection(
                    "search",
                    Post.class,
                    Parameter.with("since",
                            DateFormatter.stringToDate("2013-01-01")),
                    Parameter.with("q", "apple OR oranges"),
                    Parameter.with("type", "post"));

I have two questions.

  1. Is this the correct way of using OR
  2. I observed, even when I have mentioned "since" I get results in decreasing order in timestamp. The results start from NOW and go backwords. Is there a method to start getting methods in forward manner (something like twitter streaming API)?
¿Fue útil?

Solución

  1. You can use the | character for OR (e.g apple | oranges)

  2. Graph API always returns the latest results first, there are no parameters to control that. To work around this you could implement a Comparator that compares the Post class by time and sort the result List using Collections.html#sort(java.util.List, java.util.Comparator)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top