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 :

https://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
272 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
• 63,420 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
390 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
• 23,260 points
284 views
0 votes
1 answer

My VBA Addin creates a custom ribbon tab, but should only be visible for intended workbooks

The RibRefresh sub's logic is overly convoluted ...READ MORE

answered Feb 23, 2023 in Others by Kithuzzz
• 38,010 points
864 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,670 points
1,466 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,670 points
564 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
897 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
• 63,420 points
1,088 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
1,509 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