PageSourceSearch

https://www.societe.ninja/rna.js

js societe.ninja collected 2026-10-02 17:47:43 UTC 2,237 bytes, 66 lines download raw bytes

1function rna(siren)
2{
3	const info = {"siren":siren, "source":"RNA (Registre National des Associations)", "sourcelink":"https://entreprise.data.gouv.fr/api_doc/rna","retry":()=>rna(siren)}
4	add_source(info.source, info.sourcelink, 60)
5
6	fetch('https://entreprise.data.gouv.fr/api/rna/vi/siret/' + siren)
7	.then(function(response) 
8	{
9		if (response.ok)
10			return response.json()
11		else
12			throw response
13	})
14	.then(function (response)
15	{
16		response = Object.assign(response, info)
17
18		if (!response.ent_id_siren)
19			return update_source(response.source, 'validate')
20
21		document.getElementById('menu_rna').style.display = ''
22		document.getElementById('rna').style.display = ''
23
24		rna_addrow('Chambre', response.gest_dept + ' (' + response.gest_reg + ')', response.source)
25	
26		update_source(response.source, 'validate', response)
27	})
28	.catch(function(response)
29	{
30		response = Object.assign(response, info)
31		if (response.toString().substring(0, 9) == 'TypeError')
32			return update_source(response.source, 'refresh', '502', response, response.retry)
33		else if (response.status == 400)
34				return update_source(response.source, 'refresh', '400', "Requête mal formatée", response.retry)
35		else if (response.status == 401)
36			return update_source(response.source, 'refresh', '401', "Accès non autorisé", response.retry)
37		else if (response.status == 404)
38			return update_source(response.source, 'validate')
39		else if (response.status == 403)
40			return update_source(response.source, 'refresh', '403', "Accès refusé", response.retry)
41		else if (response.status)
42			return update_source(response.source, 'refresh', response.status, response.status + " " + response.statusText, response.retry)
43		else
44			return update_source(response.source, 'refresh', '???', response, response.retry)
45	})
46}
47
48function rna_addrow(key, value, source)
49{
50	if (document.getElementById(key))
51		document.getElementById(key).remove()
52	
53	row = document.getElementById('rna').tBodies[0].insertRow()
54	row.id = key
55	row.title = 'Source : ' + source
56	row.style.cursor = 'help'
57
58	td1 = row.insertCell()
59	td1.style.whiteSpace = 'nowrap'
60	td1.innerHTML = key
61	
62	td2 = row.insertCell()
63	td2.style.width = '100%'
64	td2.style.overflowWrap = 'anywhere'
65	td2.innerHTML = value
66}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.