Skip to content

Improving documentation with various other params that folks can use #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

gdcrocx
Copy link

@gdcrocx gdcrocx commented Oct 28, 2019

Changes only in the README.md documentation to improve usage of the code.

Copy link
Owner

@mwpenny mwpenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really appreciate the improvements to the documentation and am glad you're able to make good use of this module! Just a few comments, let me know what you think


* **Optional parameters:**
There are many different search parameters. Some of these can be used in any search (i.e., `keywords`), but most are category-specific. For example, set `params["attributeMap[petsallowed_s]"] = "[1]"` to exclude pet-unfriendly landlords when searching for apartments.

Parameters can be found by using your browser's developer tools and performing a custom search on the Kijiji website. After submitting your search on Kijiji or updating the filter being applied, use your browser's network monitoring tool to examine the request for `https://www.kijiji.ca/b-search.html`. Any parameter used in the query string for this request is able to be specified in `params`. A few examples include:
Parameters can be found by using your browser's developer tools on `https://www.kijiji.ca/b-search.html` and performing a custom search on the Kijiji website. After submitting your search on Kijiji or updating the filter being applied, use your browser's network monitoring tool to examine the request for `https://www.kijiji.ca/b-search.html`. You could also find some hidden info in the rendered HTML under the `<form>` tag with the search string `formSubmit`. Any parameter used in the query string for this request is able to be specified in `params`. A few examples include:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional mention of https://www.kijiji.ca/b-search.html seems redundant.

Great find on the hidden form. Slight rewording suggestion to be a bit more specific - how about:

You can also find possible search parameters as hidden `input` elements in the `searchForm` form in the rendered HTML

?

locationId: 1700185, // Same as kijiji.locations.ONTARIO.OTTAWA_GATINEAU_AREA.OTTAWA
categoryId: 27, // Same as kijiji.categories.CARS_AND_VEHICLES
sortByName: "priceAsc" // Show the cheapest listings first
locationId: 1700185, // REQUIRED. Same as kijiji.locations.ONTARIO.OTTAWA_GATINEAU_AREA.OTTAWA
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: could you format the spacing so all of these comments line up?

Also could you add a comment to indicate that these are not necessarily the only parameters

address: "M5R1M3", // OPTIONAL. Postal code (Use without whitespaces)
radius: 10, // OPTIONAL. Max distance from address to consider as filter while retrieving ads
adType: "OFFER", // OPTIONAL. Offer Type as provided on Kijiji.ca (Choices are: OFFER and WANTED). By default, it is any i.e. both OFFER and WANTED
hasImages: true, // OPTIONAL. Set it to 1 to avoid returning Ads without Images as shown on Kijiji.ca
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, Images should not be capitalized

adType: "OFFER", // OPTIONAL. Offer Type as provided on Kijiji.ca (Choices are: OFFER and WANTED). By default, it is any i.e. both OFFER and WANTED
hasImages: true, // OPTIONAL. Set it to 1 to avoid returning Ads without Images as shown on Kijiji.ca
"attributeMap[furnished_s]": "[1]", // OPTIONAL. Used when looking for apartments. By default, it is any i.e. No preference.
"attributeMap[petsallowed_s]": "[1]", // OPTIONAL. Used when looking for apartments. By default, it is any i.e. No preference.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attributeMap[furnished_s] and attributeMap[petsallowed_s] no longer work. Likely other attributeMap properties too. See #20 / #20 (comment). It seems Kijiji removed a bunch of filtering :(

Could you remove these from the examples? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants