Skip to content
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

Added timeframe property to allow finer-grained search. Modified URL and newURL accordingly #26

Merged
merged 4 commits into from
May 14, 2015

Conversation

ndrewr
Copy link
Contributor

@ndrewr ndrewr commented May 8, 2015

Playing with google search urls and thought this is super useful.
Source: http://www.webdistortion.com/2012/02/19/need-a-more-realtime-google-search-try-this-hack/
Gist:
add param to url: 'tbs=qdr:time_val'

Updated README with more info.

@jprichardson
Copy link
Owner

I like this, but please make the following modifications:

  1. Needs to be optional. i.e. only if resultsTimeFrame is set should the url include the tbs=qdr:time_val.
  2. Please add a test. Maybe just a simple as demonstrating the modified url would be sufficient.
  3. Prefer you to squash the README commits into one. Should be a simple rebase interactive.

@ndrewr
Copy link
Contributor Author

ndrewr commented May 10, 2015

Sure thing, I'll see what I can do. Pretty new to web development so github is borderline Magic to me!

ndrewr added 2 commits May 9, 2015 18:58
…and newURL accordingly

source: http://webdistortion.com/2012/02/19/need-a-more-realtime-google-search-try-this-hack
gist:
... secret lies in this query parameter “&tbs=qdr” – QDR I assume stands for “Query defines Relevance”

&tbs=qdr:h – this brings back information indexed in the past hour
&tbs=qdr:d – this brings back information indexed in the past day (24 hours)
&tbs=qdr:w – this brings back information indexed in the past week
&tbs=qdr:m- this brings back information indexed in the past month

and so on. Nothing magical about that..however, to get information which is fresher than an hour, you can do this directly in the browser

&tbs=qdr:n10 – this brings back information indexed in the past ten minutes
&tbs=qdr:s100 – this brings back information indexed in the past 100 seconds.
@ndrewr
Copy link
Contributor Author

ndrewr commented May 10, 2015

OK went ahead and:

  • added test: simply runs several time-filtering queries in a loop and assures that results are returned.
  • By default the url is not touched unless User has set the resultsTimeFrame prop.

Also I learned a bit about the power of rebase. Cheers!

@jprichardson
Copy link
Owner

Ok, almost there :) But now there is no update to the README file at all? The README docs were good, it's just that there were multiple commits to the README when there should of only been one. Just add this new feature to the README and then I'll merge :) Thanks!

@ndrewr
Copy link
Contributor Author

ndrewr commented May 10, 2015

Ah, I think it got Rebased out of existence. Hopefully taken care of.
BTW, I hope I didn't break the tests! The last test (setting language etc) keeps failing but I am PRETTY SURE I didn't touch it...

@jprichardson
Copy link
Owner

Hmm, maybe because so many requests are being made so quickly and google is blocking? What happens if you open three console windows and run the tests three times simultaneously, does one of them fail?

@ndrewr
Copy link
Contributor Author

ndrewr commented May 14, 2015

Wow. That took WAY longer to fix than I care to admit hahah. I was calling 'done' multiple times. Fixed test case and all tests should pass.

jprichardson added a commit that referenced this pull request May 14, 2015
Added timeframe property to allow finer-grained search. Modified URL and newURL accordingly
@jprichardson jprichardson merged commit 6a934e2 into jprichardson:master May 14, 2015
@jprichardson
Copy link
Owner

I renamed resultsTimeFrame to timeSpan. Thanks, published :)

@ndrewr
Copy link
Contributor Author

ndrewr commented May 14, 2015

Cheers for the useful tool!

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