juliomalegria / python-craigslist

Simple Craigslist wrapper
MIT No Attribution
387 stars 117 forks source link

housing_type filter #15

Closed jellis18 closed 8 years ago

jellis18 commented 8 years ago

It would be useful to have a housing type filter. I have implemented this change simply by adding

'housing_type': {'url_key': 'housing_type', 'value': None

to extra_filters dictionary in the CraigslistHousing class. However, the types are designated by number and not a string like'condo' or 'house'. I was thinking of making a function that would parse the filters dictionary so that the user could give the argument

filters={'housing_type':['condo', 'house']}

and the parser would change it to

filters={'housing_type':[2, 6]}

which is what Craigslist needs.

Let me know if this sounds ok and I can send a pull request.

juliomalegria commented 8 years ago

Hi Justin,

That's a great idea. I had some free time this weekend, so I implemented this functionality. It's currently in branch list-filters, I'll do a bit more testing and then merging it. Take a look at it if you get a chance.

Thanks for the feedback!

jellis18 commented 8 years ago

@juliomalegria, this looks good to me and it is even more flexible than what I suggested. However, I haven't really had a chance to test it out much yet.

juliomalegria commented 8 years ago

I've merged the branch, and release a new version (v1.0.2) to PyPI! Thanks for the feedback :)