@@ -142,27 +142,7 @@ def fix_state!(row)
142142
143143# Parses the contact details on the RTGS Sheet
144144# TODO: Add support for parsing NEFT contact data as well
145- def parse_contact ( std_code , phone , ifsc_code = nil )
146- # List of phone numbers that should be discarded/ignored
147- # If the scraper receives any of these phone numbers, the contact will not be updated
148- phone_numbers_to_discard = [
149- # Add specific phone numbers here that should be ignored, for example:
150- '9418404343' ,
151- '7571862000' ,
152- '8053110006' ,
153- '9596776744' ,
154- '9706738986' ,
155- '9085138862'
156- ]
157-
158- # Clean the phone number for comparison
159- clean_phone = phone . to_s . strip . gsub ( /[\s -]/ , '' )
160-
161- # Check for specific phone numbers to discard
162- if clean_phone && phone_numbers_to_discard . include? ( clean_phone )
163- return nil
164- end
165-
145+ def parse_contact ( std_code , phone )
166146 scan_contact = phone . to_s . gsub ( /[\s -]/ , '' ) . scan ( /^(\d +)\D ?/ ) . last
167147 scan_std_code = std_code . to_s . gsub ( /[\s -]/ , '' ) . scan ( /^(\d +)\D ?/ ) . last
168148
@@ -240,15 +220,15 @@ def parse_csv(files, banks, additional_attributes = {})
240220 row [ 'MICR' ] = nil
241221 end
242222
223+ row [ 'CONTACT' ] = parse_contact ( row [ 'STD CODE' ] , row [ 'PHONE' ] )
224+
243225 # There is a second header in the middle of the sheet.
244226 # :facepalm: RBI
245227 next if row [ 'IFSC' ] . nil? or [ 'IFSC_CODE' , 'BANK OF BARODA' , '' , 'KPK HYDERABAD' ] . include? ( row [ 'IFSC' ] )
246228
247229 original_ifsc = row [ 'IFSC' ]
248230 row [ 'IFSC' ] = row [ 'IFSC' ] . upcase . gsub ( /[^0-9A-Za-z]/ , '' ) . strip
249231
250- row [ 'CONTACT' ] = parse_contact ( row [ 'STD CODE' ] , row [ 'PHONE' ] , row [ 'IFSC' ] )
251-
252232 bankcode = row [ 'IFSC' ] [ 0 ..3 ]
253233
254234 if banks [ bankcode ] and banks [ bankcode ] . key? :upi and banks [ bankcode ] [ :upi ]
0 commit comments