0

I am stuck trying to get Topic information from the Freebase API. This is mostly a Ruby Faraday question anyways.

So I request at the following path: https://www.googleapis.com/freebase/v1/topic/m/02676m4?limit=20&filter=/film/film_series/films_in_series&filter=/common/topic/article

Notice how there are TWO &filter. This works just fine using my web browser. When doing either the following on Ruby, though:

response = Faraday.get 'https://www.googleapis.com/freebase/v1/topic/m/02676m4', {
        'limit' => 20,
        'filter' => ['/film/film_series/films_in_series', '/common/topic/article'],
        'key' => 'my_key_here'
    }, { 'Accept' => self.Headers_Accept }

or...

response = Faraday.get 'https://www.googleapis.com/freebase/v1/topic/m/02676m4', {
        'limit' => 20,
        'filter' => '/film/film_series/films_in_series&filter=/common/topic/article',
        'key' => 'my_key_here'
    }, { 'Accept' => self.Headers_Accept }

or...

response = Faraday.get 'https://www.googleapis.com/freebase/v1/topic/m/02676m4?limit=20&filter=/film/film_series/films_in_series&filter=/common/topic/article&key=my_key_here', {}, { 'Accept' => self.Headers_Accept }

Then Filters are ignored by the API. I get a huge response with every single piece of information regarding my topic.

You can replicate the result by performing the query with no filters: https://www.googleapis.com/freebase/v1/topic/m/02676m4?limit=20

Question: Anyone can come up with a reason why I get this issue through Faraday, but not when accessing directly through my browser?

Extra tip: If I only use one filter on the Faraday request, it works just fine. But I really need to use more than one filter.

Freebase Topic API: http://wiki.freebase.com/wiki/Topic_API

Thanks!

ArtPulse
  • 365
  • 4
  • 16

1 Answers1

0

This sounds a lot like the Faraday bug fixed by this pull request: https://github.com/technoweenie/faraday/pull/199

Tom Morris
  • 10,490
  • 32
  • 53