Custom Request Matcher for SEOMOZ VCR

0 votes

 am trying to integrate SEOMOZ API with VCR.

As the API request to SEOMOZ contains parameters that change for the same request over time, I need to implement a custom matcher.

Here is what my API call looks like :

http://lsapi.seomoz.com/linkscape/url-metrics/#{self.url}?Cols=#{cols}&AccessID=#{moz_id}&Expires=#{expires}&Signature=#{url_safe_signature} 

I also make calls to other endpoints such as Twitter,Facebook etc etc. For which the default matcher does the job well.

How can I override the matcher behavior just for SEOMOZ. Also on what parameters should I best match the request in this case.

Feb 24 in Others by Kichu
• 19,040 points
27 views

1 answer to this question.

0 votes
record the time of the test in a file with the cassettes, and use Timecop or something equivalent to ensure you're re-running the recorded test at the "same time" every time you run it.
VCR.configure do |c|
  # ...
  c.default_cassette_options = {
    # ...

    # the default is: match_requests_on: [:method :uri]
    match_requests_on: [:method, VCR.request_matchers.uri_without_params(:Signature, :Expires)]
  }
end
answered Feb 25 by narikkadan
• 10,840 points

Related Questions In Others

0 votes
1 answer

Creating custom property for .net assembly

While your compiler does not really support ...READ MORE

answered Nov 13, 2018 in Others by DataKing99
• 8,240 points
186 views
+2 votes
2 answers
0 votes
1 answer

Get files in my own file format for its own dynamic icon

Regarding MAC support, "The Mac and Windows ...READ MORE

answered Jan 8, 2019 in Others by DataKing99
• 8,240 points
554 views
0 votes
1 answer

Trying to call AWS API via PHP

Try using AWS SDK for PHP, Link ...READ MORE

answered Jun 6, 2018 in AWS by Cloud gunner
• 4,660 points
981 views
0 votes
1 answer

Problem with Swift API Gateway key authorizatiion Ask

Try to add all the headers that ...READ MORE

answered Jun 12, 2018 in AWS by Cloud gunner
• 4,660 points
345 views
+1 vote
1 answer
0 votes
1 answer

How to check payment in Blockchain.info wallet?

The above error is probably occurring due ...READ MORE

answered Aug 21, 2018 in Blockchain by Perry
• 17,100 points
540 views
0 votes
2 answers

What is most SEO optimized image HTML code for?

What is most SEO optimized image HTML ...READ MORE

answered Feb 12 in Others by gdxxfgoidt
228 views
0 votes
1 answer

Yoast Seo breadcrumbs: How to add custom text to category and tag name

use this code  add_filter('wpseo_breadcrumb_single_link', 'filter_breadcrumbs_for_h1', 10, 2); function filter_breadcrumbs_for_h1($link_output, ...READ MORE

answered Feb 12 in Others by narikkadan
• 10,840 points
63 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP