Last active
          May 6, 2019 21:49 
        
      - 
      
- 
        Save heroinbob/8b0b5e68f869b8af1fe6 to your computer and use it in GitHub Desktop. 
Revisions
- 
        heroinbob revised this gist Jun 30, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,14 +12,14 @@ require 'htmlentities' require 'cgi' letters = ('A'..'Z').to_a possibilities = letters.product letters hits = [] possibilities.each do |combos| combos.each do |combo| plate = "XXX#{combo}XXX" # Change to suite your needs! response = `curl -s 'http://www.carfax.com/processQuickVin.cfx?partnerCode=CFX&partnerSiteLocation=Y&checkReport=DEC&checkReportVersion=30&fid=&test=&cctest=&affiliateId=&subId=&bannerName=&partnerCode=CFX&partnerSiteLocation=Y&checkReport=DEC&checkReportVersion=30&fid=&test=&cctest=&affiliateId=&subId=&bannerName=&licensePlateNumber=#{plate}&licensePlateState=CA' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'Referer: http://www.carfax.com/'` if response =~ /year=(\d{4})&make=(\w+)&model=(.+?)&recordCheckType/ hits << { plate: plate, year: $1, make: $2, model: $3 } 
- 
        heroinbob created this gist Jun 25, 2015 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ # # Ridiculously basic script to search license plate combinations. # I removed the user-agent and cookie headers that I copied from # chrome, but if you need them just add your own user-agent and # cookie from the carfax site back in. # # You'll need to change the possibilites, plate pattern and regex # to suite your needs. I wrote this in about 5 minutes so it's # basic, crude and pretty unmaintainable, but gives you a sense # of what can be done. require 'htmlentities' require 'cgi' arr = ('A'..'Z').to_a possibilities = arr.map { |c| arr.map { |x| "#{c}#{x}" } } hits = [] possibilities.each do |combos| combos.each do |combo| plate = "XXX#{combo}XXX" # Change to suite your needs! response = `curl 'http://www.carfax.com/processQuickVin.cfx?partnerCode=CFX&partnerSiteLocation=Y&checkReport=DEC&checkReportVersion=30&fid=&test=&cctest=&affiliateId=&subId=&bannerName=&partnerCode=CFX&partnerSiteLocation=Y&checkReport=DEC&checkReportVersion=30&fid=&test=&cctest=&affiliateId=&subId=&bannerName=&licensePlateNumber=#{plate}&licensePlateState=CA' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'Referer: http://www.carfax.com/'` if response =~ /year=(\d{4})&make=(\w+)&model=(.+?)&recordCheckType/ hits << { plate: plate, year: $1, make: $2, model: $3 } puts "Found #{hits.last[:plate]} #{hits.last[:year]} #{hits.last[:make]} #{CGI.unescape(HTMLEntities.new.decode hits.last[:model])}" end end end puts "Found #{hits.count} plates..." puts hits.inspect