This patch adds support for using tokens in the custom query field(s).
It allows you to, for example, create "incremental" queries to only download listings that have been updated since the last time the listings class was successfully updated: (Status=A), (Last_updated_field=[drealty_class:last_updated]+).

Note: Incremental queries like in this example are probably incompatible with the new "delete/deactivate expired listings" feature recently committed. Since only recently changed items will be queued for processing and drealty diffs the queued listings to all previously fetched listings to know which ones are no longer available, it'll remove/deactivate every listing not recently changed...

I might solve that by adding support for using a separate "full sync" query to pull down a simplified list of all active listings, which is supported by my RETS server. (That query requires separate login details, which I'm not sure how to handle in drealty yet.)

Comments

camidoo’s picture

Status: Needs review » Needs work

I've gone ahead and committed this patch, however, i'd like to expand this to include the other query types and not just the default w/ offset support.

Great job btw, i really like it.

twod’s picture

I thought about that too but wasn't sure how to do it for the other queries. The only variable parts in them are the field names and those should never contain tokens...

twod’s picture

StatusFileSize
new2.53 KB

This patch adds the actual drealty-class token implementation missing from the previous file.
I've only added a few tokens so far since I only had use for the last updated time.

kevinquillen’s picture

Status: Needs work » Fixed

Added the drealty.tokens.inc to the latest dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.