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, 2022 in Others by Kichu
• 19,050 points
95 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, 2022 by narikkadan
• 53,520 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
256 views
0 votes
0 answers
0 votes
0 answers

Custom URL scheme for Pinterest on iOS Safari to open board URL?

I can't for the life of me ...READ MORE

Sep 23, 2022 in Others by gaurav
• 22,940 points
91 views
+2 votes
2 answers
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
1,131 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
419 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
666 views
0 votes
1 answer

Excel Issue- custom format for Turkish currency

What about: #.##0,00 [$₺-tr-TR] Where #.##0,00 € would do for ...READ MORE

answered Oct 10, 2022 in Others by narikkadan
• 53,520 points
281 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, 2022 in Others by gdxxfgoidt
588 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP