Skip to content

Instantly share code, notes, and snippets.

@stv0g
Created February 8, 2022 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stv0g/4f960ab635c8438de76428b52232849c to your computer and use it in GitHub Desktop.
Save stv0g/4f960ab635c8438de76428b52232849c to your computer and use it in GitHub Desktop.
SD.NET RIM Instances
import urllib.request
from urllib.error import HTTPError
import time
from bs4 import BeautifulSoup
BASE = 'https://sdnetrim.kdvz-frechen.de'
for id in range(4000, 5000):
try:
resp = urllib.request.urlopen(f'{BASE}/rim{id}')
soup = BeautifulSoup(resp, features="html.parser")
print(id, soup.title.string)
except HTTPError as e:
pass
time.sleep(1)
{"id": "4160", "url": "https://sdnetrim.kdvz-frechen.de/rim4160", "url_public": "https://ratsinfo.noervenich.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde N\u00f6rvenich", "ags": "5358052", "contactName": "Gemeinde N\u00f6rvenich ", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4160/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.809201, 6.642405]}}, "streetAddress": "Bahnhofstra\u00dfe 25", "postalCode": "52388\u00a0", "locality": "N\u00f6rvenich", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:17:55+01:00"}}}
{"id": "4170", "url": "https://sdnetrim.kdvz-frechen.de/rim4170", "url_public": "https://ratsinfo.titz.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Titz", "ags": "5358056", "contactName": "Landgemeinde Titz", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4170/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [51.003033, 6.425228]}}, "streetAddress": "Landstra\u00dfe 4", "postalCode": "52445\u00a0", "locality": "Titz", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:17:56+01:00"}}}
{"id": "4180", "url": "https://sdnetrim.kdvz-frechen.de/rim4180", "url_public": "https://ratsinfo.vettweiss.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Vettwei\u00df", "ags": "5358060", "contactName": "Gemeinde Vettwei\u00df", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4180/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.74229, 6.602083]}}, "streetAddress": "Gereonstra\u00dfe 14", "postalCode": "52391\u00a0", "locality": "Vettwei\u00df", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:17:57+01:00"}}}
{"id": "4190", "url": "https://sdnetrim.kdvz-frechen.de/rim4190", "url_public": "https://ratsinfo.heimbach-eifel.de", "oparl_versions": []}
{"id": "4210", "url": "https://sdnetrim.kdvz-frechen.de/rim4210", "url_public": "http://irich.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Aldenhoven", "ags": "05358004", "contactName": "Gemeinde Aldenhoven", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4210/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.893732, 6.28351]}}, "streetAddress": "Dietrich-M\u00fclfahrt-Stra\u00dfe 11-13", "postalCode": "52457", "locality": "Aldenhoven", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:17:58+01:00"}}}
{"id": "4220", "url": "https://sdnetrim.kdvz-frechen.de/rim4220", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4220", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde H\u00fcrtgenwald", "ags": "5358016", "contactName": "Gemeinde H\u00fcrtgenwald", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4220/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.722007, 6.395776]}}, "streetAddress": "August-Scholl-Stra\u00dfe 5", "postalCode": "52393\u00a0", "locality": "H\u00fcrtgenwald", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:00+01:00"}}}
{"id": "4230", "url": "https://sdnetrim.kdvz-frechen.de/rim4230", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4230", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Inden", "ags": "5358020", "contactName": "Stadt Inden", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4230/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.846313, 6.358528]}}, "streetAddress": "Rathausstra\u00dfe 1", "postalCode": "52459\u00a0", "locality": "Inden", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:00+01:00"}}}
{"id": "4240", "url": "https://sdnetrim.kdvz-frechen.de/rim4240", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4240", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt J\u00fclich", "ags": "5358024", "contactName": "Stadt J\u00fclich ", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4240/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.921353, 6.362877]}}, "streetAddress": "Gro\u00dfe Rurstra\u00dfe 17", "postalCode": "52428", "locality": "J\u00fclich", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:01+01:00"}}}
{"id": "4250", "url": "https://sdnetrim.kdvz-frechen.de/rim4250", "url_public": "https://ratsinfo.kreuzau.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Kreuzau", "ags": "5358028", "contactName": "Gemeinde Kreuzau", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4250/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.75128, 6.487429]}}, "streetAddress": "Bahnhofstra\u00dfe 7", "postalCode": "52372\u00a0", "locality": "Kreuzau", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:02+01:00"}}}
{"id": "4260", "url": "https://sdnetrim.kdvz-frechen.de/rim4260", "url_public": "https://ratsinfo.langerwehe.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Langerwehe", "ags": "5358032", "contactName": "Gemeinde Langerwehe", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4260/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.81335, 6.361041]}}, "streetAddress": "Sch\u00f6nthaler Stra\u00dfe 4", "postalCode": "52379\u00a0", "locality": "Langerwehe", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:03+01:00"}}}
{"id": "4270", "url": "https://sdnetrim.kdvz-frechen.de/rim4270", "url_public": "https://ratsinfo.linnich.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Linnich", "ags": "5358036", "contactName": "Stadt Linnich", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4270/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.975971, 6.268619]}}, "streetAddress": "Rurdorfer Str. 64", "postalCode": "52441\u00a0", "locality": "Linnich", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:04+01:00"}}}
{"id": "4280", "url": "https://sdnetrim.kdvz-frechen.de/rim4280", "url_public": "https://ratsinfo.gemeinde-merzenich.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Merzenich", "ags": "5358040", "contactName": "Gemeinde Merzenich", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4280/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.825377, 6.528286]}}, "streetAddress": "Valdersweg\u00a01", "postalCode": "52399\u00a0", "locality": "Merzenich", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:05+01:00"}}}
{"id": "4290", "url": "https://sdnetrim.kdvz-frechen.de/rim4290", "url_public": "https://ratsinfo.nideggen.de", "oparl_versions": []}
{"id": "4300", "url": "https://sdnetrim.kdvz-frechen.de/rim4300", "url_public": "https://ratsinfo.niederzier.de", "oparl_versions": []}
{"id": "4350", "url": "https://sdnetrim.kdvz-frechen.de/rim4350", "url_public": "https://ratsinfo.pulheim.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Pulheim", "ags": null, "contactName": null, "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4350/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "streetAddress": "Alte K\u00f6lner Stra\u00dfe 26", "postalCode": "50259", "locality": "Pulheim", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:09+01:00"}}}
{"id": "4380", "url": "https://sdnetrim.kdvz-frechen.de/rim4380", "url_public": "https://ratsinfo.stadt-frechen.de/seite", "oparl_versions": []}
{"id": "4390", "url": "https://sdnetrim.kdvz-frechen.de/rim4390", "url_public": "https://ratsinfo.huerth.de", "oparl_versions": []}
{"id": "4398", "url": "https://sdnetrim.kdvz-frechen.de/rim4398", "url_public": null, "oparl_versions": []}
{"id": "4410", "url": "https://sdnetrim.kdvz-frechen.de/rim4410", "url_public": "https://ratsinfo.bruehl.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Br\u00fchl", "ags": "5362012", "contactName": "Stadt Br\u00fchl", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4410/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.827487, 6.905614]}}, "streetAddress": "Uhlstra\u00dfe 3\u00a0", "postalCode": "50321\u00a0", "locality": "Br\u00fchl", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:13+01:00"}}}
{"id": "4420", "url": "https://sdnetrim.kdvz-frechen.de/rim4420", "url_public": "https://ratsinfo.wesseling.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Wesseling", "ags": "5362040", "contactName": "Stadt Wesseling ", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4420/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.824971, 6.98198]}}, "streetAddress": "Alfons-M\u00fcller-Platz 1", "postalCode": "50389\u00a0", "locality": "Wesseling", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:14+01:00"}}}
{"id": "4430", "url": "https://sdnetrim.kdvz-frechen.de/rim4430", "url_public": "https://ratsinfo.kdvz-frechen.de", "oparl_versions": []}
{"id": "4490", "url": "https://sdnetrim.kdvz-frechen.de/rim4490", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4490", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Erftstadt", "ags": "5362020", "contactName": "Stadt Erftstadt ", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4490/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.802509, 6.815131]}}, "streetAddress": "Holzdamm 10", "postalCode": "50374", "locality": "Erftstadt", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:16+01:00"}}}
{"id": "4500", "url": "https://sdnetrim.kdvz-frechen.de/rim4500", "url_public": "https://ratsinfo.bad-muenstereifel.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Bad M\u00fcnstereifel", "ags": "5366004", "contactName": "Stadt Bad M\u00fcnstereifel ", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4500/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.554063, 6.762666]}}, "streetAddress": "Marktstra\u00dfe 11-15", "postalCode": "53902\u00a0", "locality": "Bad M\u00fcnstereifel", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:17+01:00"}}}
{"id": "4510", "url": "https://sdnetrim.kdvz-frechen.de/rim4510", "url_public": "https://ratsinfo.weilerswist.de/", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Weilerswist", "ags": "05366040", "contactName": "Gemeinde Weilerswist", "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4510/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.752468, 6.845179]}}, "streetAddress": "Bonner Str. 29\u00a0", "postalCode": "53919", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:18+01:00"}}}
{"id": "4520", "url": "https://sdnetrim.kdvz-frechen.de/rim4520", "url_public": "https://sdnet.kreis-euskirchen.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Kreisverwaltung Euskirchen", "ags": null, "contactName": "Kreis Euskirchen", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4520/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.670915, 6.785445]}}, "streetAddress": "J\u00fclicher Ring 32", "postalCode": "53879\u00a0", "locality": "Euskirchen", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:19+01:00"}}}
{"id": "4530", "url": "https://sdnetrim.kdvz-frechen.de/rim4530", "url_public": "https://ratsinfo.zuelpich.de", "oparl_versions": []}
{"id": "4550", "url": "https://sdnetrim.kdvz-frechen.de/rim4550", "url_public": "https://ratsinfo.kall.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Kall", "ags": "5366024", "contactName": "Gemeinde Kall", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4550/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.539789, 6.557169]}}, "streetAddress": "Bahnhofstra\u00dfe 9", "postalCode": "53925\u00a0", "locality": "Kall", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:21+01:00"}}}
{"id": "4570", "url": "https://sdnetrim.kdvz-frechen.de/rim4570", "url_public": "https://ratsinfo.hellenthal.de", "oparl_versions": []}
{"id": "4580", "url": "https://sdnetrim.kdvz-frechen.de/rim4580", "url_public": "https://ratsinfo.nettersheim.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Nettersheim", "ags": "5366032", "contactName": "Gemeinde Nettersheim", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4580/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.50905, 6.656213]}}, "streetAddress": "Krausstra\u00dfe 2", "postalCode": "53947", "locality": "Nettersheim", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:23+01:00"}}}
{"id": "4600", "url": "https://sdnetrim.kdvz-frechen.de/rim4600", "url_public": "https://ratsinfo.dahlem.de", "oparl_versions": []}
{"id": "4770", "url": "https://sdnetrim.kdvz-frechen.de/rim4770", "url_public": "https://ratsinfo.stadt-kerpen.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Kolpingstadt Kerpen", "ags": "5362032", "contactName": "Kolpingstadt Kerpen", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4770/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.872779, 6.692167]}}, "streetAddress": "Jahnplatz 1", "postalCode": "50171\u00a0", "locality": "Kerpen", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:25+01:00"}}}
{"id": "4780", "url": "https://sdnetrim.kdvz-frechen.de/rim4780", "url_public": null, "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Bedburg", "ags": "5362004", "contactName": "Stadt Bedburg", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4780/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [51.00658, 6.551057]}}, "streetAddress": "Am Rathaus 1", "postalCode": "50181\u00a0", "locality": "Bedburg", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:26+01:00"}}}
{"id": "4800", "url": "https://sdnetrim.kdvz-frechen.de/rim4800", "url_public": "https://ratsinfo.bergheim.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Bergheim", "ags": "05362008 ", "contactName": "Stadt Bergheim", "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4800/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.95472, 6.6424]}}, "streetAddress": "Bethlehemer Str. 9 - 11", "postalCode": "50126", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:27+01:00"}}}
{"id": "4810", "url": "https://sdnetrim.kdvz-frechen.de/rim4810", "url_public": "https://ratsinfo.elsdorf.de", "oparl_versions": []}
{"id": "4841", "url": "https://sdnetrim.kdvz-frechen.de/rim4841", "url_public": "https://ratsinfo.simmerath.de", "oparl_versions": []}
{"id": "4861", "url": "https://sdnetrim.kdvz-frechen.de/rim4861", "url_public": "/rim4861/kennwort", "oparl_versions": []}
{"id": "4862", "url": "https://sdnetrim.kdvz-frechen.de/rim4862", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4862/kennwort", "oparl_versions": []}
{"id": "4863", "url": "https://sdnetrim.kdvz-frechen.de/rim4863", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4863/kennwort", "oparl_versions": []}
{"id": "4864", "url": "https://sdnetrim.kdvz-frechen.de/rim4864", "url_public": null, "oparl_versions": []}
{"id": "4881", "url": "https://sdnetrim.kdvz-frechen.de/rim4881", "url_public": null, "oparl_versions": []}
{"id": "4882", "url": "https://sdnetrim.kdvz-frechen.de/rim4882", "url_public": "https://ratsinfo.herzebrock-clarholz.de", "oparl_versions": []}
{"id": "4883", "url": "https://sdnetrim.kdvz-frechen.de/rim4883", "url_public": "https://ratsinfo.langenberg.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Langenberg", "ags": null, "contactName": null, "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4883/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "streetAddress": "Klutenbrinkstra\u00dfe 5", "postalCode": " 33449", "locality": "Langenberg ", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:36+01:00"}}}
{"id": "4884", "url": "https://sdnetrim.kdvz-frechen.de/rim4884", "url_public": "https://ratsinfo.borgholzhausen.de", "oparl_versions": []}
{"id": "4885", "url": "https://sdnetrim.kdvz-frechen.de/rim4885", "url_public": "https://ratsinfo.versmold.de", "oparl_versions": []}
{"id": "4886", "url": "https://sdnetrim.kdvz-frechen.de/rim4886", "url_public": "https://ratsinfo.baesweiler.de", "oparl_versions": []}
{"id": "4887", "url": "https://sdnetrim.kdvz-frechen.de/rim4887", "url_public": "https://ratsinfo.steinhagen.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Gemeinde Steinhagen", "ags": "05754040", "contactName": "Internetredaktion der Gemeinde Steinhagen", "contactEmail": "Internet@steinhagen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4887/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [52, 8]}}, "streetAddress": "Am Pulverbach 25", "postalCode": "33803", "subLocality": "Steinhagen", "locality": "Steinhagen", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:40+01:00"}}}
{"id": "4888", "url": "https://sdnetrim.kdvz-frechen.de/rim4888", "url_public": "https://infosystem.khw-wohnen.de", "oparl_versions": []}
{"id": "4889", "url": "https://sdnetrim.kdvz-frechen.de/rim4889", "url_public": "https://ratsinfo.guetersloh.de", "oparl_versions": []}
{"id": "4890", "url": "https://sdnetrim.kdvz-frechen.de/rim4890", "url_public": "http://irich.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Kreis G\u00fctersloh", "ags": null, "contactName": "Kreisverwaltung G\u00fctersloh", "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4890/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [51.905294, 8.349135]}}, "streetAddress": "Herzebrocker Stra\u00dfe 140", "postalCode": "33334", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:44+01:00"}}}
{"id": "4891", "url": "https://sdnetrim.kdvz-frechen.de/rim4891", "url_public": "https://ratsinfo.oerlinghausen.de", "oparl_versions": []}
{"id": "4892", "url": "https://sdnetrim.kdvz-frechen.de/rim4892", "url_public": "https://ratsinfo.rheda-wiedenbrueck.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Rheda-Wiedenbr\u00fcck", "ags": null, "contactName": null, "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4892/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [51.860159, 8.288335]}}, "streetAddress": "Rathausplatz 13\r\n", "postalCode": "33378\r\n", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:45+01:00"}}}
{"id": "4893", "url": "https://sdnetrim.kdvz-frechen.de/rim4893", "url_public": null, "oparl_versions": []}
{"id": "4937", "url": "https://sdnetrim.kdvz-frechen.de/rim4937", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4937/kennwort", "oparl_versions": []}
{"id": "4938", "url": "https://sdnetrim.kdvz-frechen.de/rim4938", "url_public": "https://www.paderborn.de/rathaus-service/politik", "oparl_versions": []}
{"id": "4939", "url": "https://sdnetrim.kdvz-frechen.de/rim4939", "url_public": "https://bad-driburg.rim.gkdpb.de", "oparl_versions": []}
{"id": "4940", "url": "https://sdnetrim.kdvz-frechen.de/rim4940", "url_public": "https://willebadessen.rim.gkdpb.de", "oparl_versions": []}
{"id": "4945", "url": "https://sdnetrim.kdvz-frechen.de/rim4945", "url_public": "https://ratsinfo.beverungen.de", "oparl_versions": []}
{"id": "4950", "url": "https://sdnetrim.kdvz-frechen.de/rim4950", "url_public": null, "oparl_versions": []}
{"id": "4952", "url": "https://sdnetrim.kdvz-frechen.de/rim4952", "url_public": "https://sdnet.sandhausen.de", "oparl_versions": []}
{"id": "4956", "url": "https://sdnetrim.kdvz-frechen.de/rim4956", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4956/kennwort", "oparl_versions": []}
{"id": "4957", "url": "https://sdnetrim.kdvz-frechen.de/rim4957", "url_public": "https://ratsportal.solingen.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Klingenstadt Solingen", "ags": "05122000", "contactName": "Herr Nils Gerken", "contactEmail": "solingen.digital@solingen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4957/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [7.0842486697049925, 51.177232273256024]}}, "streetAddress": "Walter-Scheel-Platz 1", "postalCode": "42651", "subLocality": "Solingen-Mitte", "locality": "Solingen", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:55+01:00"}}}
{"id": "4990", "url": "https://sdnetrim.kdvz-frechen.de/rim4990", "url_public": "http://irich.de", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Musterstadt", "ags": null, "contactName": null, "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4990/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [51.860159, 8.288335]}}, "streetAddress": "Rathausplatz 13\r\n", "postalCode": "33378\r\n", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:56+01:00"}}}
{"id": "4991", "url": "https://sdnetrim.kdvz-frechen.de/rim4991", "url_public": null, "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Kolpingstadt Kerpen", "ags": null, "contactName": null, "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4991/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:57+01:00"}}}
{"id": "4992", "url": "https://sdnetrim.kdvz-frechen.de/rim4992", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4992", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Musterstadt", "ags": "05358060", "contactName": "Gemeinde Vettwei\u00df", "contactEmail": "sdnetrim@kdvz-frechen.de", "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4992/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "geojson": {"type": "Feature", "geometry": {"type": "Point", "coordinates": [50.742337, 6.601305]}}, "streetAddress": "Gereonstra\u00dfe 14", "postalCode": "52391", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:58+01:00"}}}
{"id": "4993", "url": "https://sdnetrim.kdvz-frechen.de/rim4993", "url_public": "https://sdnetrim.kdvz-frechen.de/rim4993", "oparl_versions": ["v1.0", "v1.1"], "oparl": {"name": "Stadt Musterstadt", "ags": null, "contactName": null, "contactEmail": null, "location": {"id": "https://sdnetrim.kdvz-frechen.de/rim4993/webservice/oparl/v1.1/body/1/location/0-1", "type": "https://schema.oparl.org/1.1/Location", "created": "1970-01-01T00:00:00+01:00", "modified": "2022-02-08T23:18:59+01:00"}}}
{"id": "4994", "url": "https://sdnetrim.kdvz-frechen.de/rim4994", "url_public": null, "oparl_versions": []}
{"id": "4995", "url": "https://sdnetrim.kdvz-frechen.de/rim4995", "url_public": null, "oparl_versions": []}
{"id": "4999", "url": "https://sdnetrim.kdvz-frechen.de/rim4999", "url_public": null, "oparl_versions": []}
import urllib.request
import json
import sys
from urllib.parse import urlparse
from bs4 import BeautifulSoup
BASE = 'https://sdnetrim.kdvz-frechen.de'
rims = []
with open('rim-ids') as f:
for line in f.readlines():
id, name = line.split(' ', maxsplit=1)
resp = urllib.request.urlopen(f'{BASE}/rim{id}')
soup = BeautifulSoup(resp, features="html.parser")
content = soup.find(id='div-content')
url = None
if content:
link = content.find('a')
if link:
url = link.attrs['href'].rsplit('/', maxsplit=1)[0]
rim = {
'id': id,
'url': f'{BASE}/rim{id}',
'url_public': url,
'oparl_versions': [],
}
for version in ['v1.0', 'v1.1']:
try:
resp = urllib.request.urlopen(f'{BASE}/rim{id}/webservice/oparl/{version}/body/1')
rim['oparl_versions'].append(version)
oparl = json.load(resp)
rim['oparl'] = {k: oparl.get(k) for k in ['name', 'ags', 'contactName', 'contactEmail', 'location']}
except Exception as e:
pass
rim_json = json.dumps(rim)
print(rim_json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment