OOPSLA - Scrapheap Challenge - Challenge 1 solution
The first challenge was to provide some way for a user to find questions that had remained unanswered in their email for more than three days.
After confirming with the customer that a gmail specific solution was acceptable, and that the question could be detected by the presence of a question mark, the solution we came up with was as follows.
One way of doing is to to use the built in search capabilities in gmail and perform the following query:
in:inbox ? before:2005/10/14.
To make this more convenient, one can instead use the gmail persistent search greasmonkey script to create a link for this search. The script allows you to use the string oneweekago instead of a specific date. We patched the script to also accept threedaysago. In getRunnableQuery, we added:
var threeDaysAgo = new Date(today.getTime() - 3 * ONE_DAY); ... query = query.replace(/:threedaysago/g, ":" + getDateString(threeDaysAgo));
So, the query we used in the updated persistent search user script was:
in:inbox ? before:threedaysago

0 comments:
Post a Comment