├── README.md
└── worker.js
/README.md:
--------------------------------------------------------------------------------
1 | # Real US and Canadian Address Generator
2 |
3 | This is a simple web application that generates random real US addresses, names, genders, and phone numbers. You can also specify a state to generate addresses from that particular state. FOR LEGAL PURPOSE ONLY.
4 |
5 | ## Features
6 |
7 | - Generates a random US address including house number, street, city, state, and ZIP code.
8 | - Displays a randomly generated name and gender.
9 | - Provides a randomly generated phone number corresponding to the state.
10 | - Allows users to specify a state to generate the address.
11 | - Includes a Google Maps iframe showing the location of the generated address.
12 | - Clickable name, gender, phone number, and address to copy the details to the clipboard.
13 |
14 | ## How to Use
15 |
16 | 1. Open the application in your web browser.
17 | 2. A random address, name, gender, and phone number will be displayed.
18 | 3. Click on any of the details (name, gender, phone number, address) to copy them to the clipboard.
19 | 4. Use the dropdown menu to select a specific state and generate a new address from that state.
20 | 5. Click the "Get Another Address" button to generate a new set of details.
21 |
22 | ## Installation
23 |
24 | To use this application, you need to deploy the provided JavaScript code using Cloudflare Workers.
25 |
26 | 1. Sign up or log in to your [Cloudflare](https://www.cloudflare.com/) account.
27 | 2. Create a new Cloudflare Worker.
28 | 3. Copy the provided JavaScript code into the Cloudflare Worker script editor.
29 | 4. Save and deploy your Worker.
30 |
31 | ## Example
32 |
33 | Here's an example of what the application looks like:
34 |
35 |
36 |
37 |
38 | ## Personal Website
39 |
40 | For more information or other projects, visit my personal website: [chatgpt.org.uk](https://chatgpt.org.uk)
41 |
42 | ## License
43 |
44 | This project is licensed under the MIT License.
45 |
46 | ---
47 |
48 | © chatgpt.org.uk All rights reserved.
49 |
--------------------------------------------------------------------------------
/worker.js:
--------------------------------------------------------------------------------
1 | addEventListener('fetch', event => {
2 | event.respondWith(handleRequest(event.request))
3 | })
4 |
5 | async function handleRequest(request) {
6 | const { searchParams } = new URL(request.url)
7 | const state = searchParams.get('state') || getRandomState()
8 | let address, name, gender, phone, country
9 |
10 | const remoteProvinces = ['NL', 'NT', 'NU', 'YT'] // Remote Canadian Provinces/Territories
11 |
12 | for (let i = 0; i < 20; i++) { // Try up to 20 times to get a detailed address
13 | const location = getRandomLocationInState(state)
14 | const apiUrl = `https://nominatim.openstreetmap.org/reverse?format=json&lat=${location.lat}&lon=${location.lng}&zoom=18&addressdetails=1`
15 |
16 | const response = await fetch(apiUrl, {
17 | headers: { 'User-Agent': 'Cloudflare Worker' }
18 | })
19 | const data = await response.json()
20 |
21 | if (data && data.address) {
22 | if (data.address.country_code === 'us') {
23 | if (data.address.house_number && data.address.road && data.address.city) {
24 | country = 'US'
25 | address = formatAddress(data.address, state, country)
26 | break
27 | }
28 | } else if (data.address.country_code === 'ca') {
29 | if (remoteProvinces.includes(state)) {
30 | // For remote provinces, allow partial addresses
31 | country = 'CA'
32 | address = formatAddress(data.address, state, country)
33 | break
34 | } else {
35 | // For other provinces, require detailed address
36 | if (data.address.house_number && data.address.road && data.address.city) {
37 | country = 'CA'
38 | address = formatAddress(data.address, state, country)
39 | break
40 | }
41 | }
42 | }
43 | }
44 | }
45 |
46 | if (!address) {
47 | return new Response('Failed to retrieve detailed address', { status: 500 })
48 | }
49 |
50 | const userResp = await fetch('https://fakerapi.it/api/v1/persons?_quantity=1&_locale=en_US')
51 | const userJson = await userResp.json()
52 | if (userJson && userJson.data && userJson.data.length > 0) {
53 | const user = userJson.data[0]
54 | name = `${user.firstname} ${user.lastname}`
55 | gender = user.gender.charAt(0).toUpperCase() + user.gender.slice(1)
56 | phone = getRandomPhoneNumber(country, state)
57 | } else {
58 | name = getRandomName()
59 | gender = "Unknown"
60 | phone = getRandomPhoneNumber(country, state)
61 | }
62 |
63 | const html = `
64 |
65 |
66 |
67 | Real US & Canadian Address Generator
68 |
69 |
146 |
147 |
148 | Real US & Canadian Address Generator
149 |
150 |
Copied!
151 |
${name}
152 |
${gender}
153 |
${phone}
154 |
${address}
155 |
156 |
157 |
158 |
161 |
162 |
163 |
164 |
167 |
181 |
182 |
183 | `
184 |
185 | return new Response(html, {
186 | headers: { 'content-type': 'text/html;charset=UTF-8' },
187 | })
188 | }
189 |
190 | function getRandomLocationInState(state) {
191 | const stateCoordinates = {
192 | // US States
193 | "AL": [{ lat: 32.377716, lng: -86.300568 }, { lat: 33.520661, lng: -86.802490 }],
194 | "AK": [{ lat: 61.216583, lng: -149.899597 }, { lat: 58.301598, lng: -134.419998 }],
195 | "AZ": [{ lat: 33.448376, lng: -112.074036 }, { lat: 34.048927, lng: -111.093735 }],
196 | "AR": [{ lat: 34.746483, lng: -92.289597 }, { lat: 36.082157, lng: -94.171852 }],
197 | "CA": [{ lat: 36.778259, lng: -119.417931 }, { lat: 34.052235, lng: -118.243683 }],
198 | "CO": [{ lat: 39.739235, lng: -104.990250 }, { lat: 38.833881, lng: -104.821365 }],
199 | "CT": [{ lat: 41.763710, lng: -72.685097 }, { lat: 41.308273, lng: -72.927887 }],
200 | "DE": [{ lat: 39.739072, lng: -75.539787 }, { lat: 38.774055, lng: -75.139351 }],
201 | "FL": [{ lat: 30.332184, lng: -81.655647 }, { lat: 25.761681, lng: -80.191788 }],
202 | "GA": [{ lat: 33.749001, lng: -84.387985 }, { lat: 32.083541, lng: -81.099831 }],
203 | "HI": [{ lat: 21.306944, lng: -157.858337 }, { lat: 19.896767, lng: -155.582779 }],
204 | "ID": [{ lat: 43.615021, lng: -116.202316 }, { lat: 47.677683, lng: -116.780466 }],
205 | "IL": [{ lat: 41.878113, lng: -87.629799 }, { lat: 40.633125, lng: -89.398529 }],
206 | "IN": [{ lat: 39.768402, lng: -86.158066 }, { lat: 41.593369, lng: -87.346427 }],
207 | "IA": [{ lat: 41.586834, lng: -93.625000 }, { lat: 42.500000, lng: -94.166672 }],
208 | "KS": [{ lat: 39.099728, lng: -94.578568 }, { lat: 37.687176, lng: -97.330055 }],
209 | "KY": [{ lat: 38.252666, lng: -85.758453 }, { lat: 37.839333, lng: -84.270020 }],
210 | "LA": [{ lat: 30.695366, lng: -91.187393 }, { lat: 29.951065, lng: -90.071533 }],
211 | "ME": [{ lat: 44.310623, lng: -69.779490 }, { lat: 43.661471, lng: -70.255325 }],
212 | "MD": [{ lat: 38.978447, lng: -76.492180 }, { lat: 39.290386, lng: -76.612190 }],
213 | "MA": [{ lat: 42.360081, lng: -71.058884 }, { lat: 42.313373, lng: -71.057083 }],
214 | "MI": [{ lat: 42.732536, lng: -84.555534 }, { lat: 42.331429, lng: -83.045753 }],
215 | "MN": [{ lat: 44.953703, lng: -93.089958 }, { lat: 44.977753, lng: -93.265015 }],
216 | "MS": [{ lat: 32.298756, lng: -90.184807 }, { lat: 32.366806, lng: -88.703705 }],
217 | "MO": [{ lat: 38.576702, lng: -92.173516 }, { lat: 38.627003, lng: -90.199402 }],
218 | "MT": [{ lat: 46.878717, lng: -113.996586 }, { lat: 45.783287, lng: -108.500690 }],
219 | "NE": [{ lat: 41.256538, lng: -95.934502 }, { lat: 40.813618, lng: -96.702595 }],
220 | "NV": [{ lat: 39.163914, lng: -119.767403 }, { lat: 36.114647, lng: -115.172813 }],
221 | "NH": [{ lat: 43.208137, lng: -71.538063 }, { lat: 42.995640, lng: -71.454789 }],
222 | "NJ": [{ lat: 40.058323, lng: -74.405663 }, { lat: 39.364285, lng: -74.422928 }],
223 | "NM": [{ lat: 35.084385, lng: -106.650421 }, { lat: 32.319939, lng: -106.763653 }],
224 | "NY": [{ lat: 40.712776, lng: -74.005974 }, { lat: 43.299427, lng: -74.217933 }],
225 | "NC": [{ lat: 35.779591, lng: -78.638176 }, { lat: 35.227085, lng: -80.843124 }],
226 | "ND": [{ lat: 46.825905, lng: -100.778275 }, { lat: 46.877186, lng: -96.789803 }],
227 | "OH": [{ lat: 39.961178, lng: -82.998795 }, { lat: 41.499321, lng: -81.694359 }],
228 | "OK": [{ lat: 35.467560, lng: -97.516426 }, { lat: 36.153980, lng: -95.992775 }],
229 | "OR": [{ lat: 44.046236, lng: -123.022029 }, { lat: 45.505917, lng: -122.675049 }],
230 | "PA": [{ lat: 40.273191, lng: -76.886701 }, { lat: 39.952583, lng: -75.165222 }],
231 | "RI": [{ lat: 41.824009, lng: -71.412834 }, { lat: 41.580095, lng: -71.477429 }],
232 | "SC": [{ lat: 34.000710, lng: -81.034814 }, { lat: 32.776474, lng: -79.931051 }],
233 | "SD": [{ lat: 44.366787, lng: -100.353760 }, { lat: 43.544595, lng: -96.731103 }],
234 | "TN": [{ lat: 36.162663, lng: -86.781601 }, { lat: 35.149532, lng: -90.048981 }],
235 | "TX": [{ lat: 30.267153, lng: -97.743057 }, { lat: 29.760427, lng: -95.369804 }],
236 | "UT": [{ lat: 40.760780, lng: -111.891045 }, { lat: 37.774929, lng: -111.920414 }],
237 | "VT": [{ lat: 44.260059, lng: -72.575386 }, { lat: 44.475883, lng: -73.212074 }],
238 | "VA": [{ lat: 37.540726, lng: -77.436050 }, { lat: 36.852924, lng: -75.977982 }],
239 | "WA": [{ lat: 47.606209, lng: -122.332069 }, { lat: 47.252876, lng: -122.444290 }],
240 | "WV": [{ lat: 38.349820, lng: -81.632622 }, { lat: 39.629527, lng: -79.955896 }],
241 | "WI": [{ lat: 43.073051, lng: -89.401230 }, { lat: 43.038902, lng: -87.906471 }],
242 | "WY": [{ lat: 41.140259, lng: -104.820236 }, { lat: 44.276569, lng: -105.507391 }],
243 | // Canadian Provinces and Territories
244 | "AB": [{ lat: 51.044733, lng: -114.071883 }, { lat: 53.546124, lng: -113.493823 }],
245 | "BC": [{ lat: 49.282729, lng: -123.120738 }, { lat: 48.428421, lng: -123.365644 }],
246 | "MB": [{ lat: 49.895137, lng: -97.138374 }, { lat: 50.445211, lng: -96.823611 }],
247 | "NB": [{ lat: 45.963589, lng: -66.643115 }, { lat: 46.510712, lng: -67.255044 }],
248 | "NL": [{ lat: 53.135509, lng: -57.660435 }, { lat: 50.445211, lng: -57.100000 }],
249 | "NS": [{ lat: 44.648862, lng: -63.575320 }, { lat: 45.010474, lng: -63.416817 }],
250 | "ON": [{ lat: 51.253775, lng: -85.323214 }, { lat: 43.653225, lng: -79.383186 }],
251 | "PE": [{ lat: 46.238240, lng: -63.131074 }, { lat: 46.492424, lng: -63.793013 }],
252 | "QC": [{ lat: 46.813878, lng: -71.207980 }, { lat: 45.501689, lng: -73.567256 }],
253 | "SK": [{ lat: 52.939915, lng: -106.450863 }, { lat: 50.445211, lng: -104.618896 }],
254 | "NT": [{ lat: 64.825544, lng: -115.825340 }, { lat: 61.251955, lng: -114.352482 }],
255 | "NU": [{ lat: 64.282327, lng: -76.614813 }, { lat: 70.299598, lng: -83.107562 }],
256 | "YT": [{ lat: 64.282327, lng: -135.000000 }, { lat: 64.000000, lng: -138.000000 }]
257 | }
258 | const coordsArray = stateCoordinates[state]
259 | if (!coordsArray) {
260 | // Fallback to a default location if state/province not found
261 | return { lat: 39.8283, lng: -98.5795 } // Geographic center of the contiguous US
262 | }
263 | const randomCity = coordsArray[Math.floor(Math.random() * coordsArray.length)]
264 | const lat = randomCity.lat + (Math.random() - 0.5) * 0.1 // Smaller random offset
265 | const lng = randomCity.lng + (Math.random() - 0.5) * 0.1
266 | return { lat, lng }
267 | }
268 |
269 | function formatAddress(address, state, country) {
270 | const stateAbbreviations = {
271 | // US States
272 | "Alabama": "AL",
273 | "Alaska": "AK",
274 | "Arizona": "AZ",
275 | "Arkansas": "AR",
276 | "California": "CA",
277 | "Colorado": "CO",
278 | "Connecticut": "CT",
279 | "Delaware": "DE",
280 | "Florida": "FL",
281 | "Georgia": "GA",
282 | "Hawaii": "HI",
283 | "Idaho": "ID",
284 | "Illinois": "IL",
285 | "Indiana": "IN",
286 | "Iowa": "IA",
287 | "Kansas": "KS",
288 | "Kentucky": "KY",
289 | "Louisiana": "LA",
290 | "Maine": "ME",
291 | "Maryland": "MD",
292 | "Massachusetts": "MA",
293 | "Michigan": "MI",
294 | "Minnesota": "MN",
295 | "Mississippi": "MS",
296 | "Missouri": "MO",
297 | "Montana": "MT",
298 | "Nebraska": "NE",
299 | "Nevada": "NV",
300 | "New Hampshire": "NH",
301 | "New Jersey": "NJ",
302 | "New Mexico": "NM",
303 | "New York": "NY",
304 | "North Carolina": "NC",
305 | "North Dakota": "ND",
306 | "Ohio": "OH",
307 | "Oklahoma": "OK",
308 | "Oregon": "OR",
309 | "Pennsylvania": "PA",
310 | "Rhode Island": "RI",
311 | "South Carolina": "SC",
312 | "South Dakota": "SD",
313 | "Tennessee": "TN",
314 | "Texas": "TX",
315 | "Utah": "UT",
316 | "Vermont": "VT",
317 | "Virginia": "VA",
318 | "Washington": "WA",
319 | "West Virginia": "WV",
320 | "Wisconsin": "WI",
321 | "Wyoming": "WY",
322 | // Canadian Provinces and Territories
323 | "Alberta": "AB",
324 | "British Columbia": "BC",
325 | "Manitoba": "MB",
326 | "New Brunswick": "NB",
327 | "Newfoundland and Labrador": "NL",
328 | "Nova Scotia": "NS",
329 | "Ontario": "ON",
330 | "Prince Edward Island": "PE",
331 | "Quebec": "QC",
332 | "Saskatchewan": "SK",
333 | "Northwest Territories": "NT",
334 | "Nunavut": "NU",
335 | "Yukon": "YT"
336 | }
337 | const stateAbbr = stateAbbreviations[address.state] || state
338 | let formattedAddress = ''
339 |
340 | if (address.house_number && address.road && address.city) {
341 | if (country === 'US') {
342 | formattedAddress = `${address.house_number} ${address.road}, ${address.city}, ${stateAbbr} ${address.postcode}, United States`
343 | } else if (country === 'CA') {
344 | formattedAddress = `${address.house_number} ${address.road}, ${address.city}, ${stateAbbr} ${address.postcode}, Canada`
345 | }
346 | } else {
347 | // For partial addresses in remote provinces
348 | formattedAddress = `${address.city}, ${stateAbbr} ${address.postcode}, ${country === 'US' ? 'United States' : 'Canada'}`
349 | }
350 |
351 | return formattedAddress
352 | }
353 |
354 | function getRandomPhoneNumber(country, state) {
355 | const areaCodesUS = {
356 | "AL": ["205", "251", "256", "334", "938"],
357 | "AK": ["907"],
358 | "AZ": ["480", "520", "602", "623", "928"],
359 | "AR": ["479", "501", "870"],
360 | "CA": ["209", "213", "310", "323", "408", "415", "424", "510", "530", "559", "562", "619", "626", "650", "661", "707", "714", "760", "805", "818", "831", "858", "909", "916", "925", "949"],
361 | "CO": ["303", "719", "720", "970"],
362 | "CT": ["203", "475", "860", "959"],
363 | "DE": ["302"],
364 | "FL": ["239", "305", "321", "352", "386", "407", "561", "727", "754", "772", "786", "813", "850", "863", "904", "941", "954"],
365 | "GA": ["229", "404", "470", "478", "678", "706", "762", "770", "912"],
366 | "HI": ["808"],
367 | "ID": ["208", "986"],
368 | "IL": ["217", "224", "309", "312", "331", "618", "630", "708", "773", "779", "815", "847", "872"],
369 | "IN": ["219", "260", "317", "463", "574", "765", "812", "930"],
370 | "IA": ["319", "515", "563", "641", "712"],
371 | "KS": ["316", "620", "785", "913"],
372 | "KY": ["270", "364", "502", "606", "859"],
373 | "LA": ["225", "318", "337", "504", "985"],
374 | "ME": ["207"],
375 | "MD": ["240", "301", "410", "443", "667"],
376 | "MA": ["339", "351", "413", "508", "617", "774", "781", "857", "978"],
377 | "MI": ["231", "248", "269", "313", "517", "586", "616", "734", "810", "906", "947", "989"],
378 | "MN": ["218", "320", "507", "612", "651", "763", "952"],
379 | "MS": ["228", "601", "662", "769"],
380 | "MO": ["314", "417", "573", "636", "660", "816", "975"],
381 | "MT": ["406"],
382 | "NE": ["308", "402", "531"],
383 | "NV": ["702", "725", "775"],
384 | "NH": ["603"],
385 | "NJ": ["201", "551", "609", "732", "848", "856", "862", "908", "973"],
386 | "NM": ["505", "575"],
387 | "NY": ["212", "315", "332", "347", "516", "518", "585", "607", "631", "646", "680", "716", "718", "838", "845", "914", "917", "929", "934"],
388 | "NC": ["252", "336", "704", "743", "828", "910", "919", "980", "984"],
389 | "ND": ["701"],
390 | "OH": ["216", "234", "283", "330", "380", "419", "440", "513", "567", "614", "740", "937"],
391 | "OK": ["405", "539", "580", "918"],
392 | "OR": ["458", "503", "541", "971"],
393 | "PA": ["215", "267", "272", "412", "484", "570", "610", "717", "724", "814", "835", "878"],
394 | "RI": ["401"],
395 | "SC": ["803", "839", "843", "854", "864"],
396 | "SD": ["605"],
397 | "TN": ["423", "615", "629", "731", "865", "901", "931"],
398 | "TX": ["210", "214", "254", "281", "325", "346", "409", "430", "432", "469", "512", "682", "713", "737", "806", "817", "830", "832", "903", "915", "936", "940", "956", "972", "979"],
399 | "UT": ["385", "435", "801"],
400 | "VT": ["802"],
401 | "VA": ["276", "434", "540", "571", "703", "757", "804"],
402 | "WA": ["206", "253", "360", "425", "509"],
403 | "WV": ["304", "681"],
404 | "WI": ["262", "414", "534", "608", "715", "920"],
405 | "WY": ["307"]
406 | }
407 |
408 | const areaCodesCanada = {
409 | "AB": ["403", "587", "825"],
410 | "BC": ["236", "250", "604", "672", "778"],
411 | "MB": ["204", "431"],
412 | "NB": ["506"],
413 | "NL": ["709"],
414 | "NS": ["782", "902"],
415 | "ON": ["226", "249", "289", "343", "365", "416", "437", "519", "548", "613", "639", "647", "705", "807", "905"],
416 | "PE": ["902"],
417 | "QC": ["418", "438", "450", "514", "579", "581", "819", "873"],
418 | "SK": ["306", "639"],
419 | "NT": ["867"],
420 | "NU": ["867"],
421 | "YT": ["867"]
422 | }
423 |
424 | let areaCodeList = []
425 | if (country === 'US') {
426 | areaCodeList = areaCodesUS[state] || ["000"]
427 | } else if (country === 'CA') {
428 | areaCodeList = areaCodesCanada[state] || ["000"]
429 | }
430 | const areaCode = areaCodeList[Math.floor(Math.random() * areaCodeList.length)]
431 | const exchangeCode = Math.floor(200 + Math.random() * 700).toString().padStart(3, '0')
432 | const lineNumber = Math.floor(1000 + Math.random() * 9000).toString().padStart(4, '0')
433 | return `(${areaCode}) ${exchangeCode}-${lineNumber}`
434 | }
435 |
436 | function getRandomState() {
437 | const states = [
438 | // US States
439 | "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
440 | "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA",
441 | "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV",
442 | "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK",
443 | "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT",
444 | "VT", "VA", "WA", "WV", "WI", "WY",
445 | // Canadian Provinces and Territories
446 | "AB", "BC", "MB", "NB", "NL", "NS", "ON", "PE", "QC", "SK",
447 | "NT", "NU", "YT"
448 | ]
449 | return states[Math.floor(Math.random() * states.length)]
450 | }
451 |
452 | function getStateOptions(selectedState) {
453 | const states = [
454 | // US States
455 | { full: "Alabama", abbr: "AL", country: "US" },
456 | { full: "Alaska", abbr: "AK", country: "US" },
457 | { full: "Arizona", abbr: "AZ", country: "US" },
458 | { full: "Arkansas", abbr: "AR", country: "US" },
459 | { full: "California", abbr: "CA", country: "US" },
460 | { full: "Colorado", abbr: "CO", country: "US" },
461 | { full: "Connecticut", abbr: "CT", country: "US" },
462 | { full: "Delaware", abbr: "DE", country: "US" },
463 | { full: "Florida", abbr: "FL", country: "US" },
464 | { full: "Georgia", abbr: "GA", country: "US" },
465 | { full: "Hawaii", abbr: "HI", country: "US" },
466 | { full: "Idaho", abbr: "ID", country: "US" },
467 | { full: "Illinois", abbr: "IL", country: "US" },
468 | { full: "Indiana", abbr: "IN", country: "US" },
469 | { full: "Iowa", abbr: "IA", country: "US" },
470 | { full: "Kansas", abbr: "KS", country: "US" },
471 | { full: "Kentucky", abbr: "KY", country: "US" },
472 | { full: "Louisiana", abbr: "LA", country: "US" },
473 | { full: "Maine", abbr: "ME", country: "US" },
474 | { full: "Maryland", abbr: "MD", country: "US" },
475 | { full: "Massachusetts", abbr: "MA", country: "US" },
476 | { full: "Michigan", abbr: "MI", country: "US" },
477 | { full: "Minnesota", abbr: "MN", country: "US" },
478 | { full: "Mississippi", abbr: "MS", country: "US" },
479 | { full: "Missouri", abbr: "MO", country: "US" },
480 | { full: "Montana", abbr: "MT", country: "US" },
481 | { full: "Nebraska", abbr: "NE", country: "US" },
482 | { full: "Nevada", abbr: "NV", country: "US" },
483 | { full: "New Hampshire", abbr: "NH", country: "US" },
484 | { full: "New Jersey", abbr: "NJ", country: "US" },
485 | { full: "New Mexico", abbr: "NM", country: "US" },
486 | { full: "New York", abbr: "NY", country: "US" },
487 | { full: "North Carolina", abbr: "NC", country: "US" },
488 | { full: "North Dakota", abbr: "ND", country: "US" },
489 | { full: "Ohio", abbr: "OH", country: "US" },
490 | { full: "Oklahoma", abbr: "OK", country: "US" },
491 | { full: "Oregon", abbr: "OR", country: "US" },
492 | { full: "Pennsylvania", abbr: "PA", country: "US" },
493 | { full: "Rhode Island", abbr: "RI", country: "US" },
494 | { full: "South Carolina", abbr: "SC", country: "US" },
495 | { full: "South Dakota", abbr: "SD", country: "US" },
496 | { full: "Tennessee", abbr: "TN", country: "US" },
497 | { full: "Texas", abbr: "TX", country: "US" },
498 | { full: "Utah", abbr: "UT", country: "US" },
499 | { full: "Vermont", abbr: "VT", country: "US" },
500 | { full: "Virginia", abbr: "VA", country: "US" },
501 | { full: "Washington", abbr: "WA", country: "US" },
502 | { full: "West Virginia", abbr: "WV", country: "US" },
503 | { full: "Wisconsin", abbr: "WI", country: "US" },
504 | { full: "Wyoming", abbr: "WY", country: "US" },
505 | // Canadian Provinces and Territories
506 | { full: "Alberta", abbr: "AB", country: "CA" },
507 | { full: "British Columbia", abbr: "BC", country: "CA" },
508 | { full: "Manitoba", abbr: "MB", country: "CA" },
509 | { full: "New Brunswick", abbr: "NB", country: "CA" },
510 | { full: "Newfoundland and Labrador", abbr: "NL", country: "CA" },
511 | { full: "Nova Scotia", abbr: "NS", country: "CA" },
512 | { full: "Ontario", abbr: "ON", country: "CA" },
513 | { full: "Prince Edward Island", abbr: "PE", country: "CA" },
514 | { full: "Quebec", abbr: "QC", country: "CA" },
515 | { full: "Saskatchewan", abbr: "SK", country: "CA" },
516 | { full: "Northwest Territories", abbr: "NT", country: "CA" },
517 | { full: "Nunavut", abbr: "NU", country: "CA" },
518 | { full: "Yukon", abbr: "YT", country: "CA" }
519 | ]
520 | return states.map(state =>
521 | ``
522 | ).join('')
523 | }
524 |
525 | function getRandomName() {
526 | const firstNames = ["John", "Jane", "Alex", "Emily", "Chris", "Katie", "Mike", "Laura", "David", "Sarah"]
527 | const lastNames = ["Smith", "Johnson", "Brown", "Williams", "Jones", "Garcia", "Miller", "Davis", "Rodriguez", "Martinez"]
528 | const firstName = firstNames[Math.floor(Math.random() * firstNames.length)]
529 | const lastName = lastNames[Math.floor(Math.random() * lastNames.length)]
530 | return `${firstName} ${lastName}`
531 | }
532 |
533 | function getRandomState() {
534 | const states = [
535 | // US States
536 | "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
537 | "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA",
538 | "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV",
539 | "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK",
540 | "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT",
541 | "VT", "VA", "WA", "WV", "WI", "WY",
542 | // Canadian Provinces and Territories
543 | "AB", "BC", "MB", "NB", "NL", "NS", "ON", "PE", "QC", "SK",
544 | "NT", "NU", "YT"
545 | ]
546 | return states[Math.floor(Math.random() * states.length)]
547 | }
548 |
549 | function getStateOptions(selectedState) {
550 | const states = [
551 | // US States
552 | { full: "Alabama", abbr: "AL", country: "US" },
553 | { full: "Alaska", abbr: "AK", country: "US" },
554 | { full: "Arizona", abbr: "AZ", country: "US" },
555 | { full: "Arkansas", abbr: "AR", country: "US" },
556 | { full: "California", abbr: "CA", country: "US" },
557 | { full: "Colorado", abbr: "CO", country: "US" },
558 | { full: "Connecticut", abbr: "CT", country: "US" },
559 | { full: "Delaware", abbr: "DE", country: "US" },
560 | { full: "Florida", abbr: "FL", country: "US" },
561 | { full: "Georgia", abbr: "GA", country: "US" },
562 | { full: "Hawaii", abbr: "HI", country: "US" },
563 | { full: "Idaho", abbr: "ID", country: "US" },
564 | { full: "Illinois", abbr: "IL", country: "US" },
565 | { full: "Indiana", abbr: "IN", country: "US" },
566 | { full: "Iowa", abbr: "IA", country: "US" },
567 | { full: "Kansas", abbr: "KS", country: "US" },
568 | { full: "Kentucky", abbr: "KY", country: "US" },
569 | { full: "Louisiana", abbr: "LA", country: "US" },
570 | { full: "Maine", abbr: "ME", country: "US" },
571 | { full: "Maryland", abbr: "MD", country: "US" },
572 | { full: "Massachusetts", abbr: "MA", country: "US" },
573 | { full: "Michigan", abbr: "MI", country: "US" },
574 | { full: "Minnesota", abbr: "MN", country: "US" },
575 | { full: "Mississippi", abbr: "MS", country: "US" },
576 | { full: "Missouri", abbr: "MO", country: "US" },
577 | { full: "Montana", abbr: "MT", country: "US" },
578 | { full: "Nebraska", abbr: "NE", country: "US" },
579 | { full: "Nevada", abbr: "NV", country: "US" },
580 | { full: "New Hampshire", abbr: "NH", country: "US" },
581 | { full: "New Jersey", abbr: "NJ", country: "US" },
582 | { full: "New Mexico", abbr: "NM", country: "US" },
583 | { full: "New York", abbr: "NY", country: "US" },
584 | { full: "North Carolina", abbr: "NC", country: "US" },
585 | { full: "North Dakota", abbr: "ND", country: "US" },
586 | { full: "Ohio", abbr: "OH", country: "US" },
587 | { full: "Oklahoma", abbr: "OK", country: "US" },
588 | { full: "Oregon", abbr: "OR", country: "US" },
589 | { full: "Pennsylvania", abbr: "PA", country: "US" },
590 | { full: "Rhode Island", abbr: "RI", country: "US" },
591 | { full: "South Carolina", abbr: "SC", country: "US" },
592 | { full: "South Dakota", abbr: "SD", country: "US" },
593 | { full: "Tennessee", abbr: "TN", country: "US" },
594 | { full: "Texas", abbr: "TX", country: "US" },
595 | { full: "Utah", abbr: "UT", country: "US" },
596 | { full: "Vermont", abbr: "VT", country: "US" },
597 | { full: "Virginia", abbr: "VA", country: "US" },
598 | { full: "Washington", abbr: "WA", country: "US" },
599 | { full: "West Virginia", abbr: "WV", country: "US" },
600 | { full: "Wisconsin", abbr: "WI", country: "US" },
601 | { full: "Wyoming", abbr: "WY", country: "US" },
602 | // Canadian Provinces and Territories
603 | { full: "Alberta", abbr: "AB", country: "CA" },
604 | { full: "British Columbia", abbr: "BC", country: "CA" },
605 | { full: "Manitoba", abbr: "MB", country: "CA" },
606 | { full: "New Brunswick", abbr: "NB", country: "CA" },
607 | { full: "Newfoundland and Labrador", abbr: "NL", country: "CA" },
608 | { full: "Nova Scotia", abbr: "NS", country: "CA" },
609 | { full: "Ontario", abbr: "ON", country: "CA" },
610 | { full: "Prince Edward Island", abbr: "PE", country: "CA" },
611 | { full: "Quebec", abbr: "QC", country: "CA" },
612 | { full: "Saskatchewan", abbr: "SK", country: "CA" },
613 | { full: "Northwest Territories", abbr: "NT", country: "CA" },
614 | { full: "Nunavut", abbr: "NU", country: "CA" },
615 | { full: "Yukon", abbr: "YT", country: "CA" }
616 | ]
617 | return states.map(state =>
618 | ``
619 | ).join('')
620 | }
621 |
622 |
--------------------------------------------------------------------------------