Swader / diffbot-php-client

[Deprecated - Maintenance mode - use APIs directly please!] The official Diffbot client library
MIT License
53 stars 20 forks source link

Unable to set custom queryString parameters #39

Closed jonathantullett closed 8 years ago

jonathantullett commented 8 years ago

Hello,

I am looking for a way to set the Diffbot Querystring parameter to include additional fields. I see a number of setX methods in the API (setMeta, setQuerystring) but they only take booleans for a fixed field to be added.

As an example, I'm wanting to include fields like diffbotUri,pageUrl,title (and quite a few more - so I'm not sure that creating setX methods for each of them is appropriate).

Have I missed something within the API?

For reference, http://support.diffbot.com/crawlbot/all-about-the-querystring-parameter/

Thanks very much.

Swader commented 8 years ago

Most of the fields in a given API are now returned by default. The setters are there only for those fields that aren't actually in the returned result - so setting those will be enough. I.e., if you crawl with the Article API, just set the meta, querystring, and whatnot fields with the boolean setters, and you'll get all the other Article fields as well by default.

Let me know if this is unclear and I should clarify further. FYI there is an example in this tutorial: http://tldrify.com/f4n (link leads directly to API configuration part)

jonathantullett commented 8 years ago

Makes complete sense. The first crawl I ran didn't return any results for processing, so I thought it was something to do with the query string (which had been used in a previous trial through their website).

The crawl from yesterday worked, and indeed returns all the fields without needing any special settings.

Thanks very much!