Skip to content

Commit

Permalink
Fix Bib Nürnberg
Browse files Browse the repository at this point in the history
Closes #373
  • Loading branch information
stefanw committed Nov 21, 2023
1 parent bce72c5 commit 6ae185b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"https://go.openathens.net/*",
"https://katalog.dortmund.de/*",
"https://advance-lexis-com.eu1.proxy.openathens.net/*",
"https://*.bonn.idm.oclc.org/*"
"https://*.bonn.idm.oclc.org/*",
"https://online-service2.nuernberg.de/*"
],
"background": {
"scripts": [
Expand Down
65 changes: 45 additions & 20 deletions src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ const geniosDefaultData: PartialProviderData[] = [
// web: 'https://stabi.ludwigsburg.de/',
// domain: 'bib-ludwigsburg.genios.de'
// },
{
id: 'www.nuernberg.de/internet/stadtbibliothek',
name: 'Stadtbibliothek Nürnberg im Bildungscampus',
web: 'https://www.nuernberg.de/internet/stadtbibliothek/',
domain: 'bib-nuernberg.genios.de',
defaultSource: 'old.genios.de'
},
{
id: 'bibliothek.potsdam.de',
name: 'Stadt- und Landesbibliothek Potsdam',
Expand Down Expand Up @@ -628,30 +621,49 @@ hanData.forEach(d => {
hanProviders[d.id] = <Provider>hanFactory(d)
})

const providers: Providers = {
...geniosDefaultProviders,
...geniosAssociationProviders,
...oclcProviders,
...hanProviders,
'voebb.de': {
const astecData = [
{
id: 'voebb.de',
name: 'VÖBB - Verbund der öffenlichen Bibliotheken Berlins',
web: 'https://voebb.de/',
params: {
'www.munzinger.de': {
portalId: '50158'
},
'genios.de': {
domain: 'bib-voebb.genios.de'
}
},
domain: 'bib-voebb.genios.de',
permissions: ['https://www.voebb.de/*']
},
{
id: 'www.nuernberg.de/internet/stadtbibliothek',
name: 'Stadtbibliothek Nürnberg im Bildungscampus',
web: 'https://www.nuernberg.de/internet/stadtbibliothek/',
domain: 'bib-nuernberg.genios.de',
defaultSource: 'old.genios.de',
permissions: ['https://online-service2.nuernberg.de/*']
}
]

function astecFactory (provider) {
const defaultSource = provider.defaultSource || 'genios.de'
return {
name: provider.name,
web: provider.web,
params: {
[defaultSource]: {
domain: provider.domain
},
...(provider.params ?? {})
},
defaultSource,
login: [
[
{ click: 'input[name="CLOGIN"]', optional: true, skipToNext: true }
],
[
{ message: 'Bibliothekskonto wird eingeloggt...' },
{ fill: { selector: 'input[name="L#AUSW"]', providerKey: 'voebb.de.options.username' } },
{ fill: { selector: 'input[name="LPASSW"]', providerKey: 'voebb.de.options.password' } },
{ fill: { selector: 'input[name="L#AUSW"]', providerKey: `${provider.id}.options.username` } },
{ fill: { selector: 'input[name="LPASSW"]', providerKey: `${provider.id}.options.password` } },
{ click: 'input[name="LLOGIN"]' }
],
[
Expand All @@ -662,8 +674,21 @@ const providers: Providers = {
{ id: 'username', display: 'Nutzername:', type: 'text' },
{ id: 'password', display: 'Passwort:', type: 'password' }
],
permissions: ['https://www.voebb.de/*']
},
permissions: provider.permissions
}
}

const astecProviders = {}
astecData.forEach(d => {
astecProviders[d.id] = <Provider>astecFactory(d)
})

const providers: Providers = {
...geniosDefaultProviders,
...geniosAssociationProviders,
...oclcProviders,
...hanProviders,
...astecProviders,
'stadtbibliothek.leipzig.de': {
name: 'Leipziger Städtische Bibliotheken',
web: 'https://stadtbibliothek.leipzig.de/',
Expand Down

0 comments on commit 6ae185b

Please sign in to comment.